Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLoggedIn ¶
func IsLoggedIn() bool
func RefreshAndSave ¶
func RefreshAndSave() error
Types ¶
type Claims ¶
type Claims struct { Hasura HasuraClaims `json:"https://hasura.io/jwt/claims"` jwt.RegisteredClaims }
type HasuraClaims ¶
type HasuraClaims struct { AllowedRoles []string `json:"x-hasura-allowed-roles,omitempty"` DefaultRole string `json:"x-hasura-default-role,omitempty"` UserID string `json:"x-hasura-user-id,omitempty"` UserEmail string `json:"x-hasura-user-email,omitempty"` IsAnonymous string `json:"x-hasura-user-is-anonymous,omitempty"` }
type LoginResponse ¶
type LoginResponse struct { MFA struct { Ticket string `json:"ticket"` } `json:"mfa"` Session NhostSession `json:"session"` }
func Login ¶
func Login(payload map[string]interface{}) (*LoginResponse, error)
func RefreshToken ¶
func RefreshToken(payload map[string]interface{}) (*LoginResponse, error)
type NhostSession ¶
type NhostSession struct { AccessToken string `json:"accessToken"` AccessTokenExpiresIn int `json:"accessTokenExpiresIn"` RefreshToken string `json:"refreshToken"` User userCommons.User `json:"user"` }
Click to show internal directories.
Click to hide internal directories.