Merge fba3d9e38d
into 5cba9a4819
commit
193702f802
|
@ -30,8 +30,8 @@ Also, there is two ways to use this middleware:
|
||||||
app.use(
|
app.use(
|
||||||
'/google',
|
'/google',
|
||||||
googleAuth({
|
googleAuth({
|
||||||
client_id: Bun.env.GOOGLE_ID,
|
client_id: process.env.GOOGLE_ID,
|
||||||
client_secret: Bun.env.GOOGLE_SECRET,
|
client_secret: process.env.GOOGLE_SECRET,
|
||||||
scope: ['openid', 'email', 'profile'],
|
scope: ['openid', 'email', 'profile'],
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -57,8 +57,8 @@ Or
|
||||||
app.get(
|
app.get(
|
||||||
'/google',
|
'/google',
|
||||||
googleAuth({
|
googleAuth({
|
||||||
client_id: Bun.env.GOOGLE_ID,
|
client_id: process.env.GOOGLE_ID,
|
||||||
client_secret: Bun.env.GOOGLE_SECRET,
|
client_secret: process.env.GOOGLE_SECRET,
|
||||||
scope: ['openid', 'email', 'profile'],
|
scope: ['openid', 'email', 'profile'],
|
||||||
}),
|
}),
|
||||||
(c) => {
|
(c) => {
|
||||||
|
@ -77,6 +77,8 @@ app.get(
|
||||||
export default app
|
export default app
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you are using Bun, replace `process.env` to `Bun.env` to resolve Environments at runtime.
|
||||||
|
|
||||||
### Google
|
### Google
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
@ -88,8 +90,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/google',
|
'/google',
|
||||||
googleAuth({
|
googleAuth({
|
||||||
client_id: Bun.env.GOOGLE_ID,
|
client_id: process.env.GOOGLE_ID,
|
||||||
client_secret: Bun.env.GOOGLE_SECRET,
|
client_secret: process.env.GOOGLE_SECRET,
|
||||||
scope: ['openid', 'email', 'profile'],
|
scope: ['openid', 'email', 'profile'],
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -200,8 +202,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/facebook',
|
'/facebook',
|
||||||
facebookAuth({
|
facebookAuth({
|
||||||
client_id: Bun.env.FACEBOOK_ID,
|
client_id: process.env.FACEBOOK_ID,
|
||||||
client_secret: Bun.env.FACEBOOK_SECRET,
|
client_secret: process.env.FACEBOOK_SECRET,
|
||||||
scope: ['email', 'public_profile'],
|
scope: ['email', 'public_profile'],
|
||||||
fields: [
|
fields: [
|
||||||
'email',
|
'email',
|
||||||
|
@ -412,8 +414,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/github',
|
'/github',
|
||||||
githubAuth({
|
githubAuth({
|
||||||
client_id: Bun.env.GITHUB_ID,
|
client_id: process.env.GITHUB_ID,
|
||||||
client_secret: Bun.env.GITHUB_SECRET,
|
client_secret: process.env.GITHUB_SECRET,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -441,8 +443,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/github',
|
'/github',
|
||||||
githubAuth({
|
githubAuth({
|
||||||
client_id: Bun.env.GITHUB_ID,
|
client_id: process.env.GITHUB_ID,
|
||||||
client_secret: Bun.env.GITHUB_SECRET,
|
client_secret: process.env.GITHUB_SECRET,
|
||||||
scope: ['public_repo', 'read:user', 'user', 'user:email', 'user:follow'],
|
scope: ['public_repo', 'read:user', 'user', 'user:email', 'user:follow'],
|
||||||
oauthApp: true,
|
oauthApp: true,
|
||||||
})
|
})
|
||||||
|
@ -545,8 +547,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/linkedin',
|
'/linkedin',
|
||||||
linkedinAuth({
|
linkedinAuth({
|
||||||
client_id: Bun.env.LINKEDIN_ID,
|
client_id: process.env.LINKEDIN_ID,
|
||||||
client_secret: Bun.env.LINKEDIN_SECRET,
|
client_secret: process.env.LINKEDIN_SECRET,
|
||||||
scope: ['email', 'openid', 'profile'],
|
scope: ['email', 'openid', 'profile'],
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -575,8 +577,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/linkedin',
|
'/linkedin',
|
||||||
linkedinAuth({
|
linkedinAuth({
|
||||||
client_id: Bun.env.LINKEDIN_ID,
|
client_id: process.env.LINKEDIN_ID,
|
||||||
client_secret: Bun.env.LINKEDIN_SECRET,
|
client_secret: process.env.LINKEDIN_SECRET,
|
||||||
appAuth: true,
|
appAuth: true,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -629,8 +631,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/x',
|
'/x',
|
||||||
xAuth({
|
xAuth({
|
||||||
client_id: Bun.env.X_ID,
|
client_id: process.env.X_ID,
|
||||||
client_secret: Bun.env.X_SECRET,
|
client_secret: process.env.X_SECRET,
|
||||||
scope: ['tweet.read', 'users.read', 'offline.access'],
|
scope: ['tweet.read', 'users.read', 'offline.access'],
|
||||||
fields: ['profile_image_url', 'url'],
|
fields: ['profile_image_url', 'url'],
|
||||||
})
|
})
|
||||||
|
@ -786,8 +788,8 @@ const app = new Hono()
|
||||||
app.use(
|
app.use(
|
||||||
'/discord',
|
'/discord',
|
||||||
discordAuth({
|
discordAuth({
|
||||||
client_id: Bun.env.DISCORD_ID,
|
client_id: process.env.DISCORD_ID,
|
||||||
client_secret: Bun.env.DISCORD_SECRET,
|
client_secret: process.env.DISCORD_SECRET,
|
||||||
scope: ['identify', 'email'],
|
scope: ['identify', 'email'],
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue