MCPcopy
hub / github.com/dgraph-io/dgraph / IsJwtExpired

Function IsJwtExpired

x/x.go:1554–1562  ·  view source on GitHub ↗

IsJwtExpired returns true if the error indicates that the jwt has expired.

(err error)

Source from the content-addressed store, hash-verified

1552
1553// IsJwtExpired returns true if the error indicates that the jwt has expired.
1554func 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}

Callers 2

NewFunction · 0.92
BumpToMethod · 0.92

Calls 2

CodeMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected