auth

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const AccountClosureTemplate = `
Dear Woogles Administrators,

The following user has deleted their account:

User:  %s
Email: %s

`
View Source
const PasswordResetExpiration = 24 * time.Hour
View Source
const ResetPasswordTemplate = `` /* 278-byte string literal not displayed */
View Source
const TokenExpiration = 60 * time.Second

A little bit of grace period in case we have to redeploy the socket or something.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(password, hash string) (bool, error)

ComparePassword is used to compare a user-inputted password to a hash to see if the password matches or not.

func GeneratePassword

func GeneratePassword(c *PasswordConfig, password string) (string, error)

GeneratePassword is used to generate a new password hash for storing and comparing at a later date.

Types

type AuthenticationService

type AuthenticationService struct {
	// contains filtered or unexported fields
}

func NewAuthenticationService

func NewAuthenticationService(u user.Store, ss sessions.SessionStore, cs config.ConfigStore,
	secretKey, mailgunKey string, discordToken string, cfg config.ArgonConfig) *AuthenticationService

func (*AuthenticationService) ChangePassword

func (*AuthenticationService) GetSocketToken

func (*AuthenticationService) Login

Login sets a cookie.

func (*AuthenticationService) Logout

Logout deletes the user session from the store, and also tells the front-end to ditch the cookie (yum)

func (*AuthenticationService) NotifyAccountClosure added in v0.1.3

func (*AuthenticationService) ResetPasswordStep1 added in v0.1.1

func (*AuthenticationService) ResetPasswordStep2 added in v0.1.1

type PasswordConfig

type PasswordConfig struct {
	// contains filtered or unexported fields
}

PasswordConfig is a password configuration for argon2.

func NewPasswordConfig

func NewPasswordConfig(time int, memory int, threads int, keyLen int) *PasswordConfig

Jump to

Keyboard shortcuts

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