service

package
v1.6.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 15 Imported by: 6

Documentation

Overview

Package service contains common functions used by the whole application

Index

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 GetUserByEmail

func GetUserByEmail(email string) (*model.Auth, error)

GetUserByEmail ...

func IsTokenAllowed added in v1.6.9

func IsTokenAllowed(jti string) bool

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 SendEmail added in v1.6.1

func SendEmail(email string, emailType int) bool

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

func Validate2FA(encryptedMessage []byte, issuer string, userInput string) ([]byte, string, error)

Validate2FA validates user-provided OTP

func ValidateUserID added in v1.6.1

func ValidateUserID(authID uint64, email string) bool

ValidateUserID - check whether authID or email is missing

Types

type PostmarkParams added in v1.6.1

type PostmarkParams struct {
	ServerToken   string
	TemplateID    int64
	From          string
	To            string
	Tag           string
	TrackOpens    bool
	TrackLinks    string
	MessageStream string
	HTMLModel     map[string]interface{}
}

PostmarkParams - parameters for postmark email delivery service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL