mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-07 02:20:28 +08:00
feat: fix issue that signing up via provider in shared application will sign up to built-in app (#4093)
This commit is contained in:
@@ -719,7 +719,8 @@ func (c *ApiController) Login() {
|
||||
|
||||
setHttpClient(idProvider, provider.Type)
|
||||
|
||||
if authForm.State != conf.GetConfigString("authState") && authForm.State != application.Name {
|
||||
stateApplicationName := strings.Split(authForm.State, "-org-")[0]
|
||||
if authForm.State != conf.GetConfigString("authState") && stateApplicationName != application.Name {
|
||||
c.ResponseError(fmt.Sprintf(c.T("auth:State expected: %s, but got: %s"), conf.GetConfigString("authState"), authForm.State))
|
||||
return
|
||||
}
|
||||
|
@@ -392,7 +392,11 @@ export function getAuthUrl(application, provider, method, code) {
|
||||
let redirectUri = `${redirectOrigin}/callback`;
|
||||
let scope = authInfo[provider.type].scope;
|
||||
const isShortState = (provider.type === "WeChat" && navigator.userAgent.includes("MicroMessenger")) || (provider.type === "Twitter");
|
||||
const state = Util.getStateFromQueryParams(application.name, provider.name, method, isShortState);
|
||||
let applicationName = application.name;
|
||||
if (application?.isShared) {
|
||||
applicationName = `${application.name}-org-${application.organization}`;
|
||||
}
|
||||
const state = Util.getStateFromQueryParams(applicationName, provider.name, method, isShortState);
|
||||
const codeChallenge = "P3S-a7dr8bgM4bF6vOyiKkKETDl16rcAzao9F8UIL1Y"; // SHA256(Base64-URL-encode("casdoor-verifier"))
|
||||
|
||||
if (provider.type === "AzureAD") {
|
||||
|
Reference in New Issue
Block a user