login platform user after forced password reset (#15406)
This commit is contained in:
parent
1211811302
commit
655332715d
|
@ -30,10 +30,16 @@
|
|||
try {
|
||||
loading = true
|
||||
if (forceResetPassword) {
|
||||
const email = $auth.user.email
|
||||
const tenantId = $auth.user.tenantId
|
||||
await auth.updateSelf({
|
||||
password,
|
||||
forceResetPassword: false,
|
||||
})
|
||||
if (!$auth.user) {
|
||||
// Update self will clear the platform user, so need to login
|
||||
await auth.login(email, password, tenantId)
|
||||
}
|
||||
$goto("../portal/")
|
||||
} else {
|
||||
await auth.resetPassword(password, resetCode)
|
||||
|
|
|
@ -121,8 +121,8 @@ class AuthStore extends BudiStore<PortalAuthStore> {
|
|||
}
|
||||
}
|
||||
|
||||
async login(username: string, password: string) {
|
||||
const tenantId = get(this.store).tenantId
|
||||
async login(username: string, password: string, targetTenantId?: string) {
|
||||
const tenantId = targetTenantId || get(this.store).tenantId
|
||||
await API.logIn(tenantId, username, password)
|
||||
await this.getSelf()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue