We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a5e483 commit 3de67bfCopy full SHA for 3de67bf
models/token.go
@@ -94,6 +94,12 @@ func GetAccessTokenBySHA(token string) (*AccessToken, error) {
94
if token == "" {
95
return nil, ErrAccessTokenEmpty{}
96
}
97
+
98
+ // Existing tokens are invalid if access tokens feature is disabled.
99
+ if setting.DisableAccessTokens {
100
+ return nil, ErrAccessTokenNotExist{token}
101
+ }
102
103
// A token is defined as being SHA1 sum these are 40 hexadecimal bytes long
104
if len(token) != 40 {
105
return nil, ErrAccessTokenNotExist{token}
0 commit comments