From 59cd061572c0f9a9afc72cde9bda52de9a989458 Mon Sep 17 00:00:00 2001 From: rphlmr Date: Wed, 12 Jan 2022 19:03:06 +0100 Subject: [PATCH] prettier fix --- examples/remix-auth/.prettierrc | 7 ------- examples/remix-auth/README.md | 8 ++++---- examples/remix-auth/remix.config.js | 12 ++++++------ 3 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 examples/remix-auth/.prettierrc diff --git a/examples/remix-auth/.prettierrc b/examples/remix-auth/.prettierrc deleted file mode 100644 index 8df6df7757c..00000000000 --- a/examples/remix-auth/.prettierrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "trailingComma": "es5", - "tabWidth": 2, - "semi": false, - "singleQuote": true, - "printWidth": 100 -} diff --git a/examples/remix-auth/README.md b/examples/remix-auth/README.md index 73915d4ffe8..9b89e74d390 100644 --- a/examples/remix-auth/README.md +++ b/examples/remix-auth/README.md @@ -9,8 +9,10 @@ Authentication using `signInWithEmail` handling redirectTo. ```sh cp .env.example .env ``` + 2. Go to https://app.supabase.io/project/{PROJECT}/api?page=auth to find your secrets 3. Add your `SUPABASE_URL` and `SUPABASE_SERVICE_ROLE` in `.env` + ```env SUPABASE_SERVICE_KEY="{SERVICE_KEY}" SUPABASE_URL="https://{YOUR_INSTANCE_NAME}.supabase.co" @@ -22,7 +24,6 @@ SupabaseStrategy provides `checkSession` working like Remix Auth `isAuthenticate You must use `checkSession` instead of `isAuthenticated` - ## Example This is using Remix Auth, `remix-auth-supabase` and `supabase-js` packages. @@ -30,17 +31,16 @@ This is using Remix Auth, `remix-auth-supabase` and `supabase-js` packages. > Thanks to Remix, we can securely use server only authentication with `supabase.auth.api.signInWithEmail` > > This function should only be called on a server (`loader` or `action` functions). -> +> > **⚠️ Never expose your `service_role` key in the browser** - The `/login` route renders a form with a email and password input. After a submit it runs some validations and store `user` object, `access_token` and `refresh_token` in the session. The `/private` routes redirects the user to `/login` if it's not logged-in, or shows the user email and a logout form if it's logged-in. The `/private/profile` routes redirects the user to `/login?redirectTo=/private/profile` if it's not logged-in, or shows the user email and a logout form if it's logged-in. -If the user go to `/private/profile` and is not logged-in, it'll be redirected here after login success. +If the user go to `/private/profile` and is not logged-in, it'll be redirected here after login success. **Handle refreshing of tokens** (if expired) or redirects to `/login` if it fails diff --git a/examples/remix-auth/remix.config.js b/examples/remix-auth/remix.config.js index 076dddac7a3..78cf5b2debe 100644 --- a/examples/remix-auth/remix.config.js +++ b/examples/remix-auth/remix.config.js @@ -2,9 +2,9 @@ * @type {import('@remix-run/dev/config').AppConfig} */ module.exports = { - appDirectory: "app", - browserBuildDirectory: "public/build", - publicPath: "/build/", - serverBuildDirectory: "build", - devServerPort: 8002 -}; + appDirectory: 'app', + browserBuildDirectory: 'public/build', + publicPath: '/build/', + serverBuildDirectory: 'build', + devServerPort: 8002, +}