Skip to content

Commit 57bb530

Browse files
committed
example: update for koa@3 to get the right request origin
1 parent ca94ecc commit 57bb530

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

example/routes/koa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default (provider) => {
135135
if (ctx.method === 'POST') {
136136
ctx.status = 303;
137137
return ctx.redirect(oidc.buildAuthorizationUrl(google, {
138-
redirect_uri: new URL(GOOGLE_CALLBACK_PATHNAME, ctx.origin),
138+
redirect_uri: new URL(GOOGLE_CALLBACK_PATHNAME, ctx.request.URL.origin),
139139
scope: 'openid email profile',
140140
code_challenge: await oidc.calculatePKCECodeChallenge(code_verifier),
141141
code_challenge_method: 'S256',

0 commit comments

Comments
 (0)