Documentation ¶
Overview ¶
Package service contains common functions used by the whole application
Index ¶
- func DelMem2FA(authID uint64)
- func GetClaims(c *gin.Context) middleware.MyCustomClaims
- func GetUserByEmail(email string) (*model.Auth, error)
- func IsTokenAllowed(jti string) bool
- func JWTBlacklistChecker() gin.HandlerFunc
- func Postmark(params PostmarkParams) (postmark.EmailResponse, error)
- func SendEmail(email string, emailType int) bool
- func Validate2FA(encryptedMessage []byte, issuer string, userInput string) ([]byte, string, error)
- func ValidateUserID(authID uint64, email string) bool
- type PostmarkParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DelMem2FA ¶ added in v1.6.1
func DelMem2FA(authID uint64)
DelMem2FA - delete secrets from memory
func GetClaims ¶ added in v1.6.1
func GetClaims(c *gin.Context) middleware.MyCustomClaims
GetClaims - get JWT custom claims
func IsTokenAllowed ¶ added in v1.6.9
IsTokenAllowed returns true when the token is not in the blacklist Dependency: JWT, Redis database + enable 'INVALIDATE_JWT' in .env
func JWTBlacklistChecker ¶ added in v1.6.9
func JWTBlacklistChecker() gin.HandlerFunc
JWTBlacklistChecker validates a token against the blacklist
func Postmark ¶ added in v1.6.1
func Postmark(params PostmarkParams) (postmark.EmailResponse, error)
Postmark email delivery service using HTML templates
https://postmarkapp.com/developer/api/email-api
https://postmarkapp.com/developer/api/templates-api
https://account.postmarkapp.com/servers/{ServerID}/templates
func SendEmail ¶ added in v1.6.1
SendEmail sends a verification/password recovery email if - required by the application - an external email service is configured - a redis database is configured
func Validate2FA ¶ added in v1.6.1
Validate2FA validates user-provided OTP
func ValidateUserID ¶ added in v1.6.1
ValidateUserID - check whether authID or email is missing