Skip to content

Commit 7609542

Browse files
kubo997atinux
andauthored
fix: steam 403 error when running locally (#473)
Co-authored-by: Sébastien Chopin <atinux@gmail.com> Co-authored-by: Sébastien Chopin <seb@nuxt.com>
1 parent de77149 commit 7609542

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/server/lib/oauth/steam.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ export function defineOAuthSteamEventHandler({ config, onSuccess, onError }: OAu
3939
}
4040

4141
const url = getRequestURL(event)
42-
4342
if (!query['openid.claimed_id']) {
4443
const redirectURL = config.redirectURL || getRequestURL(event).href
44+
const realm = url.port ? `${url.protocol}//${url.hostname}:${url.port}` : `${url.protocol}//${url.hostname}`
4545
const steamOpenIdParams = {
4646
'openid.ns': 'http://specs.openid.net/auth/2.0',
4747
'openid.mode': 'checkid_setup',
4848
'openid.return_to': redirectURL,
49-
'openid.realm': `${url.protocol}//${url.hostname}`,
49+
'openid.realm': realm,
5050
'openid.identity': 'http://specs.openid.net/auth/2.0/identifier_select',
5151
'openid.claimed_id': 'http://specs.openid.net/auth/2.0/identifier_select',
5252
}

0 commit comments

Comments
 (0)