mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-22 18:25:47 +08:00
Support app user in API authentication
This commit is contained in:
parent
1055d7781b
commit
150e3e30d5
@ -96,6 +96,13 @@ func (c *ApiController) RequireSignedInUser() (*object.User, bool) {
|
|||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(userId, "app/") {
|
||||||
|
tmpUserId := c.Input().Get("userId")
|
||||||
|
if tmpUserId != "" {
|
||||||
|
userId = tmpUserId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
user, err := object.GetUser(userId)
|
user, err := object.GetUser(userId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.ResponseError(err.Error())
|
c.ResponseError(err.Error())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user