generated from tantodefi/speedrun-lukso
-
Notifications
You must be signed in to change notification settings - Fork 3
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
f3f9ba0
commit 7dd0469
Showing
6 changed files
with
71 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const url = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json" | ||
|
||
{snippets/api} | ||
|
||
const api2 = await Functions.makeHttpRequest({ | ||
url: "https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true", | ||
method: "GET", | ||
headers: { | ||
"Authorization": `Bearer ${secrets.token}` | ||
} | ||
}) | ||
if (api2.error) { | ||
throw Error("API2") | ||
} | ||
|
||
api.data.youtube = api2.data; | ||
|
||
const pinataContent = api.data; | ||
const id = api.data.id; | ||
|
||
{snippets/ipfs} |
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
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 |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import { OAuthConfig, OAuthUserConfig } from "next-auth/providers"; | ||
import { GoogleProfile } from "next-auth/providers/google"; | ||
import GoogleProvider from "next-auth/providers/google"; | ||
|
||
export default function Google<P extends GoogleProfile>(options: OAuthUserConfig<P>): OAuthConfig<P> { | ||
const result = GoogleProvider(options); | ||
// result.userinfo = { | ||
// url: "https://www.googleapis.com/oauth2/v2/userinfo?alt=json", // TODO use v2 in source code if OK | ||
// }; | ||
return result; | ||
return { | ||
id: "google", | ||
name: "Google", | ||
type: "oauth", | ||
wellKnown: "https://accounts.google.com/.well-known/openid-configuration", | ||
authorization: { params: { scope: "openid email profile https://www.googleapis.com/auth/youtube.readonly" } }, | ||
idToken: true, | ||
checks: ["pkce", "state"], | ||
profile(profile) { | ||
return { | ||
id: profile.sub, | ||
name: profile.name, | ||
email: profile.email, | ||
image: profile.picture, | ||
}; | ||
}, | ||
style: { logo: "/google.svg", bg: "#fff", text: "#000" }, | ||
options, | ||
}; | ||
} |