mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: use short state for OAuth provider (#2504)
* fix: use fixed length of state * fix: use short state
This commit is contained in:
parent
6c72f86d03
commit
7786018051
@ -382,7 +382,7 @@ export function getAuthUrl(application, provider, method) {
|
|||||||
let redirectUri = `${window.location.origin}/callback`;
|
let redirectUri = `${window.location.origin}/callback`;
|
||||||
const scope = authInfo[provider.type].scope;
|
const scope = authInfo[provider.type].scope;
|
||||||
|
|
||||||
const isShortState = provider.type === "WeChat" && navigator.userAgent.includes("MicroMessenger");
|
const isShortState = (provider.type === "WeChat" && navigator.userAgent.includes("MicroMessenger")) || (provider.type === "Twitter");
|
||||||
const state = Util.getStateFromQueryParams(application.name, provider.name, method, isShortState);
|
const state = Util.getStateFromQueryParams(application.name, provider.name, method, isShortState);
|
||||||
const codeChallenge = "P3S-a7dr8bgM4bF6vOyiKkKETDl16rcAzao9F8UIL1Y"; // SHA256(Base64-URL-encode("casdoor-verifier"))
|
const codeChallenge = "P3S-a7dr8bgM4bF6vOyiKkKETDl16rcAzao9F8UIL1Y"; // SHA256(Base64-URL-encode("casdoor-verifier"))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user