Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Redirect to sign in if assurance level check fails on MFA page (#17906)

Joshen Lim6a5433f033b9
diff --git a/studio/pages/sign-in-mfa.tsx b/studio/pages/sign-in-mfa.tsx
index 3929b85ed0b..fbc47d7dd03 100644
--- a/studio/pages/sign-in-mfa.tsx
+++ b/studio/pages/sign-in-mfa.tsx
@@ -6,6 +6,7 @@ import { usePushNext } from 'hooks/misc/useAutoAuthRedirect'
import { auth, buildPathWithParams, getAccessToken } from 'lib/gotrue'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
+import toast from 'react-hot-toast'
import { NextPageWithLayout } from 'types'
const SignInMfaPage: NextPageWithLayout = () => {
@@ -31,8 +32,11 @@ const SignInMfaPage: NextPageWithLayout = () => {
const { data, error } = await auth.mfa.getAuthenticatorAssuranceLevel()
if (error) {
// if there was a problem signing in via the url, don't redirect
+ toast.error(
+ `Failed to retrieve assurance level: ${error.message}. Please try signing in again`
+ )
setLoading(false)
- return
+ return router.push('/sign-in')
}
if (data) {