Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit c73bddd

Browse files
author
jonas747
committed
temporarily disable token invalidation code
webhook and interaction endpoints return 401 on a bad webhook/interaction token, so this will break our session when our auth token is fine. workaround for this could be firing up another request to /users/@me and double checking wether our token is actually invalid or not but for now just disable it
1 parent ffb3de5 commit c73bddd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

restapi.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,14 @@ func (s *Session) doRequest(method, urlStr, contentType string, b []byte, bucket
169169
// this method can cause longer delays than required
170170
return nil, true, true, nil
171171

172-
case http.StatusUnauthorized:
173-
if strings.Index(s.Token, "Bot ") != 0 {
174-
s.log(LogInformational, ErrUnauthorized.Error())
175-
err = ErrUnauthorized
176-
} else {
177-
atomic.StoreInt32(s.tokenInvalid, 1)
178-
err = ErrTokenInvalid
179-
}
172+
// case http.StatusUnauthorized:
173+
// if strings.Index(s.Token, "Bot ") != 0 {
174+
// s.log(LogInformational, ErrUnauthorized.Error())
175+
// err = ErrUnauthorized
176+
// } else {
177+
// atomic.StoreInt32(s.tokenInvalid, 1)
178+
// err = ErrTokenInvalid
179+
// }
180180
default: // Error condition
181181
if resp.StatusCode >= 500 || resp.StatusCode < 400 {
182182
// non 400 response code

0 commit comments

Comments
 (0)