forgejo/services/auth
Giteabot 968ab550e5
Fix the error message when the token is incorrect (#25701) (#25834)
Backport #25701 by @CaiCandong

we refactored `userIDFromToken` for the token parsing part into a new
function `parseToken`. `parseToken` returns the string `token` from
request, and a boolean `ok` representing whether the token exists or
not. So we can distinguish between token non-existence and token
inconsistency in the `verfity` function, thus solving the problem of no
proper error message when the token is inconsistent.
close #24439
related #22119

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit ee87b4e18c)
2023-07-17 10:15:44 +02:00
..
source Fix accidental overwriting of LDAP team memberships (#24050) (#24065) 2023-04-12 07:22:02 -04:00
auth.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
auth_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
basic.go Require repo scope for PATs for private repos and basic authentication (#24362) (#24364) 2023-04-26 20:57:51 -04:00
group.go Fix the error message when the token is incorrect (#25701) (#25834) 2023-07-17 10:15:44 +02:00
httpsign.go refactor auth interface to return error when verify failure (#22119) 2022-12-28 13:53:28 +08:00
interface.go refactor auth interface to return error when verify failure (#22119) 2022-12-28 13:53:28 +08:00
middleware.go Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
oauth2.go Fix the error message when the token is incorrect (#25701) (#25834) 2023-07-17 10:15:44 +02:00
reverseproxy.go Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
session.go refactor auth interface to return error when verify failure (#22119) 2022-12-28 13:53:28 +08:00
signin.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
source.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
sspi_windows.go refactor auth interface to return error when verify failure (#22119) 2022-12-28 13:53:28 +08:00
sync.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00