mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: fix JWT generate issue cause by shared application (#3113)
* fix: fix jwt generate cause by shared application * fix: fix built-in org will not add -org-
This commit is contained in:
parent
97dcf24a91
commit
45e25acc80
@ -365,6 +365,10 @@ func generateJwtToken(application *Application, user *User, nonce string, scope
|
||||
},
|
||||
}
|
||||
|
||||
if application.IsShared {
|
||||
claims.Audience = []string{application.ClientId + "-org-" + user.Owner}
|
||||
}
|
||||
|
||||
var token *jwt.Token
|
||||
var refreshToken *jwt.Token
|
||||
|
||||
|
@ -1009,7 +1009,7 @@ class ApplicationEditPage extends React.Component {
|
||||
}
|
||||
|
||||
let clientId = this.state.application.clientId;
|
||||
if (this.state.application.isShared && this.props.account.owner !== "built-in") {
|
||||
if (this.state.application.isShared) {
|
||||
clientId += `-org-${this.props.account.owner}`;
|
||||
}
|
||||
const signInUrl = `/login/oauth/authorize?client_id=${clientId}&response_type=code&redirect_uri=${redirectUri}&scope=read&state=casdoor`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user