-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7cb5d7
commit 3a85f0c
Showing
55 changed files
with
77 additions
and
5,971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { type LoaderFunctionArgs } from '@remix-run/node' | ||
import { authenticator } from '#app/modules/auth/auth.server' | ||
import { ROUTE_PATH as LOGIN_PATH } from '#app/routes/_auth+/login' | ||
|
||
export const ROUTE_PATH = '/auth/:provider/callback' as const | ||
|
||
export async function loader({ request, params }: LoaderFunctionArgs) { | ||
if (typeof params.provider !== 'string') throw new Error('Invalid provider.') | ||
|
||
return authenticator.authenticate(params.provider, request, { | ||
successRedirect: '/', | ||
failureRedirect: LOGIN_PATH, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { type ActionFunctionArgs, redirect } from '@remix-run/node' | ||
|
||
import { authenticator } from '#app/modules/auth/auth.server' | ||
import { ROUTE_PATH as LOGIN_PATH } from '#app/routes/_auth+/login' | ||
|
||
export const ROUTE_PATH = '/auth/:provider' as const | ||
|
||
export async function loader() { | ||
return redirect(LOGIN_PATH) | ||
} | ||
|
||
export async function action({ request, params }: ActionFunctionArgs) { | ||
if (typeof params.provider !== 'string') throw new Error('Invalid provider.') | ||
return authenticator.authenticate(params.provider, request) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.