修改部分错误显示内容

This commit is contained in:
xmdhs 2023-10-11 15:46:49 +08:00
parent eeb64c84db
commit 6cba9ada31
No known key found for this signature in database
GPG Key ID: E809D6D43DEFCC95
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ var ErrNotAdmin = errors.New("无权限")
func (w *WebService) Auth(ctx context.Context, token string) (*model.TokenClaims, error) {
t, err := utilsService.Auth(ctx, yggdrasil.ValidateToken{AccessToken: token}, w.client, w.cache, &w.prikey.PublicKey, false)
if err != nil {
return nil, fmt.Errorf("Auth: %w", err)
return nil, fmt.Errorf("WebService.Auth: %w", err)
}
return t, nil
}

View File

@ -67,7 +67,7 @@ func Auth(ctx context.Context, t yggdrasil.ValidateToken, client *ent.Client, c
if err != nil {
var ne *ent.NotFoundError
if errors.As(err, &ne) {
return 0, errors.Join(err, ErrTokenInvalid)
return 0, ErrTokenInvalid
}
return 0, err
}