feat: support accessKey and accessSecret login in AutoSigninFilter (#3117)

This commit is contained in:
DacongDA
2024-08-12 12:20:41 +08:00
committed by GitHub
parent b4e51b4631
commit ab5fcf848e

View File

@ -67,6 +67,17 @@ func AutoSigninFilter(ctx *context.Context) {
return return
} }
accessKey := ctx.Input.Query("accessKey")
accessSecret := ctx.Input.Query("accessSecret")
if accessKey != "" && accessSecret != "" {
userId, err := getUsernameByKeys(ctx)
if err != nil {
responseError(ctx, err.Error())
}
setSessionUser(ctx, userId)
}
// "/page?clientId=123&clientSecret=456" // "/page?clientId=123&clientSecret=456"
userId, err := getUsernameByClientIdSecret(ctx) userId, err := getUsernameByClientIdSecret(ctx)
if err != nil { if err != nil {