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