The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix magic link
Jonathan Summers-Muir641a71a81658
diff --git a/apps/docs/pages/guides/auth/auth-magic-link.mdx b/apps/docs/pages/guides/auth/auth-magic-link.mdxnew file mode 100644index 00000000000..e6a74aa8354--- /dev/null+++ b/apps/docs/pages/guides/auth/auth-magic-link.mdx@@ -0,0 +1,97 @@+import Layout from '~/layouts/DefaultGuideLayout'++export const meta = {+ id: 'auth-magic-link',+ title: 'Login With Magic Link',+ description: 'Use Supabase to authenticate and authorize your users using magic links.',+}++Magic links are a form of passwordless logins where users click on a link sent to their email address to log in to their accounts.+Magic links only work with email addresses. By default, a user can only request a magic link once every 60 seconds.++## Overview++Setting up Magic Link logins for your Supabase application.++- Add Magic Link authenticator to your [Supabase Project](https://app.supabase.com)+- Add the login code to your application - [JavaScript](https://github.com/supabase/supabase-js) | [Flutter](https://github.com/supabase/supabase-flutter)++## Add Magic Link into your Supabase Project++1. For [Site URL](https://app.supabase.com/project/_/auth/url-configuration), enter the final (hosted) URL of your app.+1. For [Auth Providers](https://app.supabase.com/project/_/auth/providers), **enable email provider**.++## Add login code to your client app++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="js"+>+<TabPanel id="js" label="JavaScript">+When your user signs in, call [signInWithOtp()](/docs/reference/javascript/auth-signinwithotp) with their email address:++```js+async function signInWithEmail() {+ const { data, error } = await supabase.auth.signInWithOtp({+ email: '[email protected]',+ options: {+ emailRedirectTo: 'https://example.com/welcome',+ },+ })+}+```++</TabPanel>+<TabPanel id="dart" label="Dart">++When your user signs in, call [signIn()](/docs/reference/dart/auth-signinwithotp) with their email address:++```dart+Future<void> signInWithEmail() async {+ final AuthResponse res = await supabase.auth.signinwithotp(email: '[email protected]');+}+```++</TabPanel>+</Tabs>++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="js"+>+<TabPanel id="js" label="JavaScript">+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:++```js+async function signOut() {+ const { error } = await supabase.auth.signOut()+}+```++</TabPanel>+<TabPanel id="dart" label="Dart">++When your user signs out, call [signOut()](/docs/reference/dart/auth-signout) to remove them from the browser session and any objects from localStorage:++```dart+Future<void> signOut() async {+ await supabase.auth.signOut();+}+```++</TabPanel>+</Tabs>++## Resources++- [Supabase Account - Free Tier OK](https://supabase.com)+- [Supabase JS Client](https://github.com/supabase/supabase-js)+- [Supabase Flutter Client](https://github.com/supabase/supabase-flutter)++export const Page = ({ children }) => <Layout meta={meta} children={children} />++export default Pagediff --git a/apps/www/lib/redirects.js b/apps/www/lib/redirects.jsindex b967ff306b6..689399ad404 100644--- a/apps/www/lib/redirects.js+++ b/apps/www/lib/redirects.js@@ -1606,55 +1606,22 @@ module.exports = [source: '/docs/guides/auth/passwordless-login',destination: '/docs/guides/auth/phone-login',},- {- permanent: true,- source: '/docs/guides/auth/passwordless-login/email-otp-magic-link',- destination: '/docs/guides/auth/auth-magic-link',- },{permanent: true,source: '/docs/guides/auth/passwordless-login/phone-sms-otp-messagebird',destination: '/docs/guides/auth/phone-login/messagebird',- source: '/docs/guides/auth',- destination: '/docs/guides/auth/overview',- },- {- permanent: true,- source: '/docs/guides/auth/auth-magic-link',- destination: '/docs/guides/auth/passworldless-login/email-otp-magic-link',},+ { permanent: true, source: '/docs/guides/auth', destination: '/docs/guides/auth/overview' },{permanent: true,source: '/docs/guides/auth/auth-messagebird',destination: '/docs/guides/auth/phone-login/messagebird',},- {- permanent: true,- source: '/docs/guides/auth/passwordless-login/phone-sms-otp-twilio',- destination: '/docs/guides/auth/phone-login/twilio',- },{permanent: true,source: '/docs/guides/auth-twilio',destination: '/docs/guides/auth/phone-login/twilio',},- {- permanent: true,- source: '/docs/guides/auth/passwordless-login/phone-sms-otp-vonage',- destination: '/docs/guides/auth/phone-login/vonage',- destination: '/docs/guides/auth/passworldless-login/phone-sms-otp-messagebird',- },- {- permanent: true,- source: '/docs/guides/auth/auth-twilio',- destination: '/docs/guides/auth/passworldless-login/phone-sms-otp-twilio',- },- {- permanent: true,- source: '/docs/guides/auth/auth-vonage',- destination: '/docs/guides/auth/phone-login/vonage',- destination: '/docs/guides/auth/passworldless-login/phone-sms-otp-vonage',- },{permanent: true,source: '/docs/guides/auth/with-google',