-
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.
feat!: implement github login button ( without access code ).
- Loading branch information
Showing
4 changed files
with
20 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
import { env } from '$env/dynamic/private'; | ||
|
||
export const GH_STATE_COOKIE_NAME = 'gh_state'; | ||
export const GH_ACCESS_TOKEN_COOKIE_NAME = 'gh_token'; | ||
|
||
let GH_CLIENT_ID_; | ||
let GH_CLIENT_SECRET_; | ||
if (process.env) { | ||
GH_CLIENT_ID_ = process.env['GH_CLIENT_ID']; | ||
GH_CLIENT_SECRET_ = process.env['GH_CLIENT_SECRET']; | ||
} else { | ||
GH_CLIENT_ID_ = (Deno as any).env.get('GH_CLIENT_ID'); | ||
GH_CLIENT_SECRET_ = (Deno as any).env.get('GH_CLIENT_SECRET'); | ||
} | ||
|
||
export const GH_CLIENT_ID = GH_CLIENT_ID_; | ||
export const GH_CLIENT_SECRET = GH_CLIENT_SECRET_; | ||
export const GH_CLIENT_ID = env['GH_CLIENT_ID']; | ||
export const GH_CLIENT_SECRET = env['GH_CLIENT_SECRET']; |
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,8 @@ | ||
export const csr = false; | ||
|
||
import { GH_CLIENT_ID } from '../../../config'; | ||
import type { PageLoad } from './$types'; | ||
|
||
export const load = (({ params, url }) => { | ||
return { GH_CLIENT_ID, state: crypto.randomUUID(), href: url.href }; | ||
}) satisfies PageLoad; |
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 @@ | ||
Auth callback |