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