Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWTClaims ¶
type JWTClaims struct { ID string `bson:"_id" json:"id"` jwt.StandardClaims }
JWTClaims is the user information embedded in the JWT. We add jwt.StandardClaims as an embedded type, to provide fields like expiry time
type User ¶
type User struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` Name string `json:"name" bson:"name"` Lastname string `json:"lastname" bson:"lastname"` Email string `json:"email" bson:"email"` // IDs in external authentication providers. GoogleID string `json:"-" bson:"googleId"` GoogleToken string `json:"-" bson:"googleToken"` FacebookID string `json:"-" bson:"facebookId"` FacebookToken string `json:"-" bson:"facebookToken"` }
User is the representation of an user in the system.
func Create ¶
func Create(ctx context.Context, db database.Client, provider string, userInfo auth.ProviderUser) (*User, error)
Create adds a user record to the database.
func GetByProviderID ¶
GetByProviderID returns a user whose provider's ID matches the given one.
Click to show internal directories.
Click to hide internal directories.