Skip to content

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

Fixed multiple minor papercuts.

Ivan Vasilov641d4cd3794e
diff --git a/studio/components/interfaces/SignIn/SignInMfaForm.tsx b/studio/components/interfaces/SignIn/SignInMfaForm.tsx
index c32c6d48ec2..5a1f14e0e81 100644
--- a/studio/components/interfaces/SignIn/SignInMfaForm.tsx
+++ b/studio/components/interfaces/SignIn/SignInMfaForm.tsx
@@ -72,54 +72,54 @@ const SignInMfaForm = () => {
validationSchema={signInSchema}
onSubmit={onSignIn}
>
- return (
- <div className="flex flex-col gap-4">
- <Input
- id="code"
- name="code"
- type="text"
- icon={<IconLock />}
- placeholder="XXXXXX"
- disabled={isLoading}
- autoComplete="off"
- spellCheck="false"
- autoCapitalize="none"
- autoCorrect="off"
- label={
- selectedFactor && factors?.totp.length === 2
- ? `Code generated by ${selectedFactor.friendly_name}`
- : null
- }
- />
+ {() => (
+ <div className="flex flex-col gap-4">
+ <Input
+ id="code"
+ name="code"
+ type="text"
+ icon={<IconLock />}
+ placeholder="XXXXXX"
+ disabled={isLoading}
+ autoComplete="off"
+ spellCheck="false"
+ autoCapitalize="none"
+ autoCorrect="off"
+ label={
+ selectedFactor && factors?.totp.length === 2
+ ? `Code generated by ${selectedFactor.friendly_name}`
+ : null
+ }
+ />
- <Button
- block
- form="sign-in-mfa-form"
- htmlType="submit"
- size="large"
- disabled={isLoading}
- loading={isLoading}
- >
- {isLoading ? 'Verifying' : 'Verify'}
- </Button>
- {factors?.totp.length === 2 && (
- <div className="text-sm flex flex-col items-center w-full gap-1">
- <div>
- <span className="text-scale-900">Having problems?</span>{' '}
- <a
- className="text-white hover:border-b border-white"
- href="#"
- onClick={() =>
- setSelectedFactor(factors.totp.find((f) => f.id !== selectedFactor?.id)!)
- }
- >{`Authenticate using ${
- factors.totp.find((f) => f.id !== selectedFactor?.id)?.friendly_name
- }?`}</a>
+ <Button
+ block
+ form="sign-in-mfa-form"
+ htmlType="submit"
+ size="large"
+ disabled={isLoading}
+ loading={isLoading}
+ >
+ {isLoading ? 'Verifying' : 'Verify'}
+ </Button>
+ {factors?.totp.length === 2 && (
+ <div className="text-sm flex flex-col items-center w-full gap-1">
+ <div>
+ <span className="text-scale-900">Having problems?</span>{' '}
+ <a
+ className="text-white hover:border-b border-white"
+ href="#"
+ onClick={() =>
+ setSelectedFactor(factors.totp.find((f) => f.id !== selectedFactor?.id)!)
+ }
+ >{`Authenticate using ${
+ factors.totp.find((f) => f.id !== selectedFactor?.id)?.friendly_name
+ }?`}</a>
+ </div>
</div>
- </div>
- )}
- </div>
- )
+ )}
+ </div>
+ )}
</Form>
)
}
diff --git a/studio/data/profile/mfa-list-factors-query.ts b/studio/data/profile/mfa-list-factors-query.ts
index 29171d3b099..47b44458bae 100644
--- a/studio/data/profile/mfa-list-factors-query.ts
+++ b/studio/data/profile/mfa-list-factors-query.ts
@@ -2,9 +2,6 @@ import { AuthMFAListFactorsResponse } from '@supabase/supabase-js'
import { useQuery, UseQueryOptions } from '@tanstack/react-query'
import { auth } from 'lib/gotrue'
import { profileKeys } from './keys'
-import { Profile } from './types'
-
-export type ProfileResponse = Profile
export async function getMfaListFactors() {
const { error, data } = await auth.mfa.listFactors()
diff --git a/studio/data/profile/mfa-unenroll-mutation.ts b/studio/data/profile/mfa-unenroll-mutation.ts
index 903efb9f98b..c3ab09cfa94 100644
--- a/studio/data/profile/mfa-unenroll-mutation.ts
+++ b/studio/data/profile/mfa-unenroll-mutation.ts
@@ -6,7 +6,6 @@ import { profileKeys } from './keys'
const mfaUnenroll = async (params: MFAUnenrollParams) => {
const { error, data } = await auth.mfa.unenroll(params)
- auth.mfa.listFactors
if (error) throw error
return data
}
diff --git a/studio/pages/account/security.tsx b/studio/pages/account/security.tsx
index 911801ca462..18050504d4d 100644
--- a/studio/pages/account/security.tsx
+++ b/studio/pages/account/security.tsx
@@ -16,6 +16,7 @@ import {
Alert_Shadcn_,
Badge,
Button,
+ IconAlertCircle,
IconAlertTriangle,
IconSmartphone,
IconTrash,
@@ -103,15 +104,26 @@ const ProfileCard = () => {
)}
{isSuccess && (
<>
+ {data.totp.length === 1 && (
+ <Alert_Shadcn_ variant="default" className="mt-2">
+ <IconAlertCircle className="h-4 w-4" />
+ <AlertTitle_Shadcn_>
+ We recommend configuring two authenticator apps across different devices
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_ className="flex flex-col gap-3">
+ The two authenticator apps will serve as a backup for each other.
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ )}
<div className="py-2">
{data.totp.map((factor) => {
return (
<div key={factor.id} className="flex flex-row justify-between py-2">
<div className="flex flex-col">
- <span className="text-sm text-white">Factor ID: {factor.id}</span>
- <span className="text-sm text-scale-900">
+ <span className="text-sm text-white">
Name: {factor.friendly_name ?? 'No name provided'}
</span>
+ <span className="text-sm text-scale-900">Factor ID: {factor.id}</span>
</div>
<div className="flex items-center gap-2">
<span className="text-sm text-scale-900">
diff --git a/studio/pages/sign-in-mfa.tsx b/studio/pages/sign-in-mfa.tsx
index aaafe13a6a7..eabad37f83e 100644
--- a/studio/pages/sign-in-mfa.tsx
+++ b/studio/pages/sign-in-mfa.tsx
@@ -15,7 +15,7 @@ const SignInMfaPage: NextPageWithLayout = () => {
SignInMfaPage.getLayout = (page) => (
<SignInLayout
heading="Two-factor authentication"
- subheading="Enter the authentication code from your two-factor authentication (TOTP) app"
+ subheading="Enter the authentication code from your two-factor authentication (TOTP) app"
logoLinkToMarketingSite={true}
>
{page}