services

package
v0.0.0-...-bb65b11 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ConfirmRegistrationTemplate = `` /* 600-byte string literal not displayed */
View Source
const EmailPasswordTemplate = `` /* 534-byte string literal not displayed */

Variables

This section is empty.

Functions

func AddEvent

func AddEvent(user models.Account, event, target, ip, ua string) models.ActionEvent

func AddNotifySubscriber

func AddNotifySubscriber(user models.Account, provider, device, ua string) (models.NotificationSubscriber, error)

func Authenticate

func Authenticate(access, refresh string, depth int) (models.Account, string, string, error)

func ConfirmAccount

func ConfirmAccount(code string) error

func CreateAccount

func CreateAccount(name, nick, email, password string) (models.Account, error)

func GetAccount

func GetAccount(id uint) (models.Account, error)

func GetFactorCode

func GetFactorCode(factor models.AuthFactor) (bool, error)

func GetThirdClient

func GetThirdClient(id string) (models.ThirdClient, error)

func GetThirdClientWithSecret

func GetThirdClientWithSecret(id, secret string) (models.ThirdClient, error)

func LookupAccount

func LookupAccount(id string) (models.Account, error)

func LookupChallenge

func LookupChallenge(id uint) (models.AuthChallenge, error)

func LookupChallengeWithFingerprint

func LookupChallengeWithFingerprint(id uint, ip string, ua string) (models.AuthChallenge, error)

func LookupFactor

func LookupFactor(id uint) (models.AuthFactor, error)

func LookupFactorsByUser

func LookupFactorsByUser(uid uint) ([]models.AuthFactor, error)

func LookupSessionWithToken

func LookupSessionWithToken(tokenId string) (models.AuthSession, error)

func NewMagicToken

func NewMagicToken(mode models.MagicTokenType, assignTo *models.Account, expiredAt *time.Time) (models.MagicToken, error)

func NewNotification

func NewNotification(
	user models.ThirdClient,
	target models.Account,
	subject, content string,
	links []models.NotificationLink,
	important bool,
) error

func NotifyMagicToken

func NotifyMagicToken(token models.MagicToken) error

func PerformAutoSignoff

func PerformAutoSignoff() *gorm.DB

func SendMail

func SendMail(target string, subject string, content string) error

func SendMailHTML

func SendMailHTML(target string, subject string, content string) error

func ValidateMagicToken

func ValidateMagicToken(code string, mode models.MagicTokenType) (models.MagicToken, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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