Monorepo for Tangled tangled.org
6

Configure Feed

Select the types of activity you want to include in your feed.

at icy/sntnrt 539 B View raw
1package oauth 2 3import "regexp" 4 5var ( 6 permanentAuthErrorRe = regexp.MustCompile(`\b(invalid_grant|invalid_client|unauthorized_client)\b`) 7 staleAccessTokenErrRe = regexp.MustCompile(`HTTP 401\b.*(AuthenticationRequired|Invalid OAuth access token|invalid_token)`) 8) 9 10func IsPermanentAuthErr(err error) bool { 11 if err == nil { 12 return false 13 } 14 return permanentAuthErrorRe.MatchString(err.Error()) 15} 16 17func IsStaleAccessTokenErr(err error) bool { 18 if err == nil { 19 return false 20 } 21 return staleAccessTokenErrRe.MatchString(err.Error()) 22}