mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
Fix state encoding for Moodle
This commit is contained in:
parent
c84150cede
commit
6b42d35223
@ -86,7 +86,13 @@ export function getOAuthGetParameters(params) {
|
|||||||
const responseType = getRefinedValue(queries.get("response_type"));
|
const responseType = getRefinedValue(queries.get("response_type"));
|
||||||
const redirectUri = getRefinedValue(queries.get("redirect_uri"));
|
const redirectUri = getRefinedValue(queries.get("redirect_uri"));
|
||||||
const scope = getRefinedValue(queries.get("scope"));
|
const scope = getRefinedValue(queries.get("scope"));
|
||||||
const state = getRefinedValue(queries.get("state"));
|
|
||||||
|
let state = getRefinedValue(queries.get("state"));
|
||||||
|
if (state.startsWith("/auth/oauth2/login.php?wantsurl=")) {
|
||||||
|
// state contains URL param encoding for Moodle, URLSearchParams automatically decoded it, so here encode it again
|
||||||
|
state = encodeURIComponent(state);
|
||||||
|
}
|
||||||
|
|
||||||
const nonce = getRefinedValue(queries.get("nonce"));
|
const nonce = getRefinedValue(queries.get("nonce"));
|
||||||
const challengeMethod = getRefinedValue(queries.get("code_challenge_method"));
|
const challengeMethod = getRefinedValue(queries.get("code_challenge_method"));
|
||||||
const codeChallenge = getRefinedValue(queries.get("code_challenge"));
|
const codeChallenge = getRefinedValue(queries.get("code_challenge"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user