Skip to content

Commit fa3a923

Browse files
committed
1.9 Add support for magic link
1 parent c946063 commit fa3a923

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/lib/auth/AuthContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const AuthProvider: FunctionComponent = ({
5252
if (error) {
5353
handleMessage({ message: error.message, type: 'error' })
5454
} else {
55-
handleMessage({ message: `Welcome, ${user.email}`, type: 'success' })
55+
handleMessage({ message: payload.password.length ? `Welcome, ${user.email}`: `Please check your email for the magic link`, type: 'success' })
5656
}
5757
} catch (error) {
5858
handleMessage({ message: error.error_description || error, type: 'error' })

src/lib/auth/auth.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
export type SupabaseAuthPayload = {
33
email: string,
4-
password: string
4+
password?: string
55
}

src/pages/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ const IndexPage: NextPage<NextAppPageProps> = ({}) => {
7171
name="password"
7272
type="password"
7373
className="h-12 px-4 py-2 bg-white rounded shadow-inner border-gray-300 w-full border hover:border-gray-400"
74-
placeholder="Your password"
75-
required
74+
placeholder="Your password. Leave empty for password-less login"
7675
value={values.password}
7776
onChange={handleChange}
7877
/>

0 commit comments

Comments
 (0)