fix some other bugs of iam
This commit is contained in:
@@ -162,6 +162,10 @@ const sendToken = async (otpCode: string) => {
|
||||
const verified = await api.verifyOtp(String(formModel.username ?? ''), otpCode)
|
||||
const { token, customer } = verified
|
||||
session.login(token, customer.id, customer.mobile)
|
||||
if (verified.iamBootstrapUrl) {
|
||||
window.location.assign(verified.iamBootstrapUrl)
|
||||
return
|
||||
}
|
||||
// D21 — ask the server which kind of principal this token is, so the
|
||||
// expert-only entries appear for a sales expert. Failure is non-fatal:
|
||||
// the entries simply stay hidden, and the server refuses those routes
|
||||
@@ -172,10 +176,6 @@ const sendToken = async (otpCode: string) => {
|
||||
} catch {
|
||||
session.setSalesExpert(false)
|
||||
}
|
||||
if (verified.iamBootstrapUrl) {
|
||||
window.location.assign(verified.iamBootstrapUrl)
|
||||
return
|
||||
}
|
||||
const redirect = typeof route.query.redirect === 'string' ? route.query.redirect : undefined
|
||||
await router.push(redirect ?? { name: 'home' })
|
||||
toast.success('با موفقیت وارد شدید')
|
||||
|
||||
Reference in New Issue
Block a user