Redirect to account page for account password reset (#15404)
This commit is contained in:
parent
655332715d
commit
0fbcfcd33c
|
@ -15,6 +15,7 @@
|
|||
import {
|
||||
appsStore,
|
||||
organisation,
|
||||
admin,
|
||||
auth,
|
||||
groups,
|
||||
licensing,
|
||||
|
@ -42,6 +43,7 @@
|
|||
app => app.status === AppStatus.DEPLOYED
|
||||
)
|
||||
$: userApps = getUserApps(publishedApps, userGroups, $auth.user)
|
||||
$: isOwner = $auth.accountPortalAccess && $admin.cloud
|
||||
|
||||
function getUserApps(publishedApps, userGroups, user) {
|
||||
if (sdk.users.isAdmin(user)) {
|
||||
|
@ -111,7 +113,13 @@
|
|||
</MenuItem>
|
||||
<MenuItem
|
||||
icon="LockClosed"
|
||||
on:click={() => changePasswordModal.show()}
|
||||
on:click={() => {
|
||||
if (isOwner) {
|
||||
window.location.href = `${$admin.accountPortalUrl}/portal/account`
|
||||
} else {
|
||||
changePasswordModal.show()
|
||||
}
|
||||
}}
|
||||
>
|
||||
Update password
|
||||
</MenuItem>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { auth } from "@/stores/portal"
|
||||
import { admin, auth } from "@/stores/portal"
|
||||
import { ActionMenu, MenuItem, Icon, Modal } from "@budibase/bbui"
|
||||
import { goto } from "@roxi/routify"
|
||||
import ProfileModal from "@/components/settings/ProfileModal.svelte"
|
||||
|
@ -13,6 +13,8 @@
|
|||
let updatePasswordModal
|
||||
let apiKeyModal
|
||||
|
||||
$: isOwner = $auth.accountPortalAccess && $admin.cloud
|
||||
|
||||
const logout = async () => {
|
||||
try {
|
||||
await auth.logout()
|
||||
|
@ -32,7 +34,16 @@
|
|||
</MenuItem>
|
||||
<MenuItem icon="Moon" on:click={() => themeModal.show()}>Theme</MenuItem>
|
||||
{#if !$auth.isSSO}
|
||||
<MenuItem icon="LockClosed" on:click={() => updatePasswordModal.show()}>
|
||||
<MenuItem
|
||||
icon="LockClosed"
|
||||
on:click={() => {
|
||||
if (isOwner) {
|
||||
window.location.href = `${$admin.accountPortalUrl}/portal/account`
|
||||
} else {
|
||||
updatePasswordModal.show()
|
||||
}
|
||||
}}
|
||||
>
|
||||
Update password
|
||||
</MenuItem>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in New Issue