Documentation ¶
Index ¶
Constants ¶
View Source
const (
// SessionAuthorizationClaimsKey - the session key storing the authorization claims.
SessionAuthorizationClaimsKey = "authorizationClaims"
)
Variables ¶
This section is empty.
Functions ¶
func AuthenticationInterceptor ¶
AuthenticationInterceptor - the interceptor for all need authorization APIs.
func CreateTokenForUser ¶
CreateTokenForUser - creates the token of specific user, by their phone. Since we don't support multi-login, we will replace the existing cached token of the phone when this function called.
func RemoveUserToken ¶
func RemoveUserToken(phone string)
RemoveUserToken - remove the user token in the token cache.
Types ¶
type AuthorizationClaims ¶
type AuthorizationClaims struct { Generated int64 `json:"generated"` Phone string `json:"phone"` jwt.StandardClaims }
AuthorizationClaims - the customized JWT claims for type-safe type. More details are available at https://github.com/dgrijalva/jwt-go/issues/287
Click to show internal directories.
Click to hide internal directories.