Documentation
¶
Index ¶
- func LoginWithEmailAndPasswordHandler(getUserByEmail func(email string) (AuthUserEmail, error)) func(c *fiber.Ctx) error
- func LoginWithEmailOTPHandler(getUserByEmail func(email string) (AuthUserEmail, error)) func(c *fiber.Ctx) error
- func LoginWithPhoneOTPHandler(getUserByPhone func(phone string) (AuthUserPhone, error)) func(c *fiber.Ctx) error
- func VerifyEmailOTPHandler(getUserByEmail func(email string) (AuthUserEmail, error)) func(c *fiber.Ctx) error
- func VerifyPhoneOTPHandler(getUserByPhone func(phone string) (AuthUserPhone, error)) func(c *fiber.Ctx) error
- type AuthUserEmail
- type AuthUserPhone
- type GoogleAuth
- func (ga *GoogleAuth) GetGoogleOauthURL() string
- func (ga *GoogleAuth) GetSessionData() func(c *fiber.Ctx) error
- func (ga *GoogleAuth) GoogleCallbackBuilder(...) func(c *fiber.Ctx) error
- func (ga *GoogleAuth) GoogleHandleCallback() func(c *fiber.Ctx) error
- func (ga *GoogleAuth) GoogleLoginBuilder(authHandler func(c *fiber.Ctx) error) func(c *fiber.Ctx) error
- func (ga *GoogleAuth) GoogleLoginHandler() func(c *fiber.Ctx) error
- func (ga *GoogleAuth) IsGoogleAuthenticated(c *fiber.Ctx) bool
- func (ga *GoogleAuth) RequireGoogleAuth() func(c *fiber.Ctx) error
- type GoogleCallbackData
- type JWTClaimsProvider
- type LoginWithEmailAndPasswordRequest
- type LoginWithEmailOTPRequest
- type LoginWithPhoneOTPRequest
- type ResponseHTTP
- type User
- func (u *User) AdditionalClaims() map[string]interface{}
- func (u *User) GetEmail() string
- func (u *User) GetID() string
- func (u *User) GetJWTClaims() map[string]interface{}
- func (u *User) GetPassword() string
- func (u *User) GetPhone() string
- func (u *User) SetAdditionalClaims(claims map[string]interface{})
- type VerifyEmailOTPRequest
- type VerifyPhoneOTPRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoginWithEmailOTPHandler ¶ added in v1.15.5
func LoginWithEmailOTPHandler(getUserByEmail func(email string) (AuthUserEmail, error)) func(c *fiber.Ctx) error
LoginWithEmailOTPHandler initiates an OTP flow by generating an OTP, storing it in Redis (5 min expiration), and emailing it to the user.
func VerifyEmailOTPHandler ¶ added in v1.15.5
func VerifyEmailOTPHandler(getUserByEmail func(email string) (AuthUserEmail, error)) func(c *fiber.Ctx) error
VerifyEmailOTPHandler verifies the OTP sent to email and returns a JWT. If the user exists, user-specific claims are added.
func VerifyPhoneOTPHandler ¶
Types ¶
type AuthUserEmail ¶
type AuthUserEmail interface {
GetEmail() string
GetPassword() string
GetID() string
JWTClaimsProvider
}
func NewAuthUserEmail ¶ added in v1.2.23
func NewAuthUserEmail(email, password, id string) AuthUserEmail
type AuthUserPhone ¶
type AuthUserPhone interface {
GetPhone() string
GetPassword() string
GetID() string
JWTClaimsProvider
}
func NewAuthUserPhone ¶ added in v1.2.23
func NewAuthUserPhone(phone, password, id string) AuthUserPhone
type GoogleAuth ¶ added in v1.2.12
type GoogleAuth struct {
// contains filtered or unexported fields
}
func InitializeGoogleAuth ¶ added in v1.2.12
func InitializeGoogleAuth(config models.GoogleConfig) *GoogleAuth
func NewGoogleAuth ¶ added in v1.2.12
func NewGoogleAuth(config models.GoogleConfig) *GoogleAuth
func (*GoogleAuth) GetGoogleOauthURL ¶ added in v1.2.12
func (ga *GoogleAuth) GetGoogleOauthURL() string
func (*GoogleAuth) GetSessionData ¶ added in v1.2.19
func (ga *GoogleAuth) GetSessionData() func(c *fiber.Ctx) error
func (*GoogleAuth) GoogleCallbackBuilder ¶ added in v1.2.12
func (*GoogleAuth) GoogleHandleCallback ¶ added in v1.2.12
func (ga *GoogleAuth) GoogleHandleCallback() func(c *fiber.Ctx) error
func (*GoogleAuth) GoogleLoginBuilder ¶ added in v1.2.12
func (*GoogleAuth) GoogleLoginHandler ¶ added in v1.2.12
func (ga *GoogleAuth) GoogleLoginHandler() func(c *fiber.Ctx) error
func (*GoogleAuth) IsGoogleAuthenticated ¶ added in v1.2.12
func (ga *GoogleAuth) IsGoogleAuthenticated(c *fiber.Ctx) bool
func (*GoogleAuth) RequireGoogleAuth ¶ added in v1.2.12
func (ga *GoogleAuth) RequireGoogleAuth() func(c *fiber.Ctx) error
type GoogleCallbackData ¶ added in v1.2.15
type JWTClaimsProvider ¶
type LoginWithEmailOTPRequest ¶ added in v1.15.5
type LoginWithEmailOTPRequest struct {
Email string `json:"email"`
}
Email OTP request payloads
type LoginWithPhoneOTPRequest ¶
type LoginWithPhoneOTPRequest struct {
Phone string `json:"phone"`
}
type ResponseHTTP ¶
type User ¶ added in v1.2.23
type User struct {
Id string `json:"id"`
Email string `json:"email"`
Phone string `json:"phone"`
Password string `json:"password"`
AddedClaims map[string]interface{} `json:"additional_claims"`
}
func (*User) AdditionalClaims ¶ added in v1.2.23
func (*User) GetJWTClaims ¶ added in v1.2.23
func (*User) GetPassword ¶ added in v1.2.23
func (*User) SetAdditionalClaims ¶ added in v1.3.34
type VerifyEmailOTPRequest ¶ added in v1.15.5
type VerifyPhoneOTPRequest ¶
Click to show internal directories.
Click to hide internal directories.