IsJwtExpired returns true if the error indicates that the jwt has expired.
(err error)
| 1552 | |
| 1553 | // IsJwtExpired returns true if the error indicates that the jwt has expired. |
| 1554 | func IsJwtExpired(err error) bool { |
| 1555 | if err == nil { |
| 1556 | return false |
| 1557 | } |
| 1558 | |
| 1559 | st, ok := status.FromError(err) |
| 1560 | return ok && st.Code() == codes.Unauthenticated && |
| 1561 | strings.Contains(err.Error(), "Token is expired") |
| 1562 | } |