Spaces:
Sleeping
Sleeping
coyotte508
commited on
Commit
·
7325361
1
Parent(s):
4927d19
fix pkce
Browse files
src/lib/server/auth.ts
CHANGED
|
@@ -320,12 +320,14 @@ export async function getOIDCUserData(
|
|
| 320 |
url: URL
|
| 321 |
): Promise<OIDCUserInfo> {
|
| 322 |
const client = await getOIDCClient(settings, url);
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
|
|
|
|
|
|
| 329 |
const userData = await client.userinfo(token);
|
| 330 |
|
| 331 |
return { token, userData };
|
|
|
|
| 320 |
url: URL
|
| 321 |
): Promise<OIDCUserInfo> {
|
| 322 |
const client = await getOIDCClient(settings, url);
|
| 323 |
+
const token = await client.callback(
|
| 324 |
+
settings.redirectURI,
|
| 325 |
+
{
|
| 326 |
+
code,
|
| 327 |
+
iss,
|
| 328 |
+
},
|
| 329 |
+
{ code_verifier: codeVerifier }
|
| 330 |
+
);
|
| 331 |
const userData = await client.userinfo(token);
|
| 332 |
|
| 333 |
return { token, userData };
|
src/routes/.well-known/oauth-cimd/+server.ts
CHANGED
|
@@ -19,11 +19,7 @@ export const GET = ({ url }) => {
|
|
| 19 |
client_id: new URL(url, config.PUBLIC_ORIGIN || url.origin).toString(),
|
| 20 |
client_name: config.PUBLIC_APP_NAME,
|
| 21 |
client_uri: `${config.PUBLIC_ORIGIN || url.origin}${base}`,
|
| 22 |
-
redirect_uris: [
|
| 23 |
-
new URL("/login/callback", config.PUBLIC_ORIGIN || url.origin).toString(),
|
| 24 |
-
// todo: remove this
|
| 25 |
-
`http://localhost:5173/login/callback`,
|
| 26 |
-
],
|
| 27 |
token_endpoint_auth_method: "none",
|
| 28 |
scopes: OIDConfig.SCOPES,
|
| 29 |
}),
|
|
|
|
| 19 |
client_id: new URL(url, config.PUBLIC_ORIGIN || url.origin).toString(),
|
| 20 |
client_name: config.PUBLIC_APP_NAME,
|
| 21 |
client_uri: `${config.PUBLIC_ORIGIN || url.origin}${base}`,
|
| 22 |
+
redirect_uris: [new URL("/login/callback", config.PUBLIC_ORIGIN || url.origin).toString()],
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
token_endpoint_auth_method: "none",
|
| 24 |
scopes: OIDConfig.SCOPES,
|
| 25 |
}),
|