Compare commits
3 Commits
26174f5c22
...
b3b920c0f6
Author | SHA1 | Date |
---|---|---|
|
b3b920c0f6 | |
|
0debb59474 | |
|
437426cfc4 |
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/oauth-providers': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add availbility to pass parameter state into OAuth middlewares
|
|
@ -0,0 +1,18 @@
|
||||||
|
name: codestyle
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: ['*']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20.x
|
||||||
|
- run: yarn
|
||||||
|
- run: yarn format
|
||||||
|
- run: yarn lint
|
|
@ -12,10 +12,11 @@ export function facebookAuth(options: {
|
||||||
fields: Fields[]
|
fields: Fields[]
|
||||||
client_id?: string
|
client_id?: string
|
||||||
client_secret?: string
|
client_secret?: string
|
||||||
|
state?: string
|
||||||
redirect_uri?: string
|
redirect_uri?: string
|
||||||
}): MiddlewareHandler {
|
}): MiddlewareHandler {
|
||||||
return async (c, next) => {
|
return async (c, next) => {
|
||||||
const newState = getRandomState()
|
const newState = options.state || getRandomState()
|
||||||
// Create new Auth instance
|
// Create new Auth instance
|
||||||
const auth = new AuthFlow({
|
const auth = new AuthFlow({
|
||||||
client_id: options.client_id || (env(c).FACEBOOK_ID as string),
|
client_id: options.client_id || (env(c).FACEBOOK_ID as string),
|
||||||
|
|
|
@ -12,10 +12,11 @@ export function githubAuth(options: {
|
||||||
client_secret?: string
|
client_secret?: string
|
||||||
scope?: GitHubScope[]
|
scope?: GitHubScope[]
|
||||||
oauthApp?: boolean
|
oauthApp?: boolean
|
||||||
|
state?: string
|
||||||
redirect_uri?: string
|
redirect_uri?: string
|
||||||
}): MiddlewareHandler {
|
}): MiddlewareHandler {
|
||||||
return async (c, next) => {
|
return async (c, next) => {
|
||||||
const newState = getRandomState()
|
const newState = options.state || getRandomState()
|
||||||
// Create new Auth instance
|
// Create new Auth instance
|
||||||
const auth = new AuthFlow({
|
const auth = new AuthFlow({
|
||||||
client_id: options.client_id || (env(c).GITHUB_ID as string),
|
client_id: options.client_id || (env(c).GITHUB_ID as string),
|
||||||
|
|
|
@ -12,10 +12,11 @@ export function linkedinAuth(options: {
|
||||||
client_secret?: string
|
client_secret?: string
|
||||||
scope?: LinkedInScope[]
|
scope?: LinkedInScope[]
|
||||||
appAuth?: boolean
|
appAuth?: boolean
|
||||||
|
state?: string
|
||||||
redirect_uri?: string
|
redirect_uri?: string
|
||||||
}): MiddlewareHandler {
|
}): MiddlewareHandler {
|
||||||
return async (c, next) => {
|
return async (c, next) => {
|
||||||
const newState = getRandomState()
|
const newState = options.state || getRandomState()
|
||||||
// Create new Auth instance
|
// Create new Auth instance
|
||||||
const auth = new AuthFlow({
|
const auth = new AuthFlow({
|
||||||
client_id: options.client_id || (env(c).LINKEDIN_ID as string),
|
client_id: options.client_id || (env(c).LINKEDIN_ID as string),
|
||||||
|
|
|
@ -13,11 +13,12 @@ export function xAuth(options: {
|
||||||
fields?: XFields[]
|
fields?: XFields[]
|
||||||
client_id?: string
|
client_id?: string
|
||||||
client_secret?: string
|
client_secret?: string
|
||||||
|
state?: string
|
||||||
redirect_uri?: string
|
redirect_uri?: string
|
||||||
}): MiddlewareHandler {
|
}): MiddlewareHandler {
|
||||||
return async (c, next) => {
|
return async (c, next) => {
|
||||||
// Generate encoded "keys"
|
// Generate encoded "keys"
|
||||||
const newState = getRandomState()
|
const newState = options.state || getRandomState()
|
||||||
const challenge = await getCodeChallenge()
|
const challenge = await getCodeChallenge()
|
||||||
|
|
||||||
const auth = new AuthFlow({
|
const auth = new AuthFlow({
|
||||||
|
|
Loading…
Reference in New Issue