fix: redirect url for github apps (#280)
parent
cfaa80a9e7
commit
14443cc255
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/oauth-providers': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
ensure redirect to original URL for GitHub apps
|
|
@ -40,7 +40,11 @@ export function githubAuth(options: {
|
||||||
path: '/',
|
path: '/',
|
||||||
// secure: true,
|
// secure: true,
|
||||||
})
|
})
|
||||||
return c.redirect(auth.redirect())
|
|
||||||
|
// OAuth apps can't have multiple callback URLs, but GitHub Apps can.
|
||||||
|
// As such, we want to make sure we call back to the same location
|
||||||
|
// for GitHub apps and not the first configured callbackURL in the app config.
|
||||||
|
return c.redirect(auth.redirect().concat(options.oauthApp ? '' : `&redirect_uri=${c.req.url}`))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve user data from github
|
// Retrieve user data from github
|
||||||
|
|
Loading…
Reference in New Issue