修改部分枚举字段的编号与注释确保 0 值的正确语义
This commit is contained in:
@@ -26,12 +26,12 @@ func (s *authService) OauthClientCredentials(ctx context.Context, client *m.Clie
|
||||
|
||||
var clientType PayloadType
|
||||
switch client.Spec {
|
||||
case 0:
|
||||
clientType = PayloadClientConfidential
|
||||
case 1:
|
||||
clientType = PayloadClientPublic
|
||||
case 2:
|
||||
clientType = PayloadClientPublic
|
||||
case 3:
|
||||
clientType = PayloadClientConfidential
|
||||
}
|
||||
|
||||
var permissions = make(map[string]struct{}, len(scope))
|
||||
@@ -50,7 +50,7 @@ func (s *authService) OauthClientCredentials(ctx context.Context, client *m.Clie
|
||||
}
|
||||
|
||||
// todo 数据库定义会话持续时间
|
||||
token, err := Session.Create(ctx, auth)
|
||||
token, err := Session.Create(ctx, auth, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -145,11 +145,7 @@ func (s *authService) OauthPassword(ctx context.Context, _ *m.Client, data *Gran
|
||||
},
|
||||
}
|
||||
|
||||
duration := DefaultSessionConfig
|
||||
if !data.Remember {
|
||||
duration.RefreshTokenDuration = 0
|
||||
}
|
||||
token, err := Session.Create(ctx, auth)
|
||||
token, err := Session.Create(ctx, auth, data.Remember)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user