Merge branch 'master' into feature/js-logging
This commit is contained in:
commit
866677a3fb
|
@ -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