Merge branch 'master' into feature/js-logging

This commit is contained in:
Michael Drury 2025-01-21 12:02:09 +00:00 committed by GitHub
commit 866677a3fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -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)

View File

@ -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()
}