authentication

package
v0.0.0-...-e834163 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SUPER_DUPER_SECRET_KEY []byte = []byte(os.Getenv("SALT")) //this will be moved...

Functions

func AuthenticateUserLogin

func AuthenticateUserLogin(username string, password string, requestIP string, requestUserAgent string) (*user.User, error)

AuthenticateUserLogin - authenticates a users credentials and returns the user or an error

func GenerateSessionToken

func GenerateSessionToken(validUser user.User) string

GenerateSessionToken use user identifying info to generate a session token

func VerifyAndProcessToken

func VerifyAndProcessToken(token string, requestIP string, requestUA string) (*user.User, error)

VerifyAndProcessToken for a given token verify it is untampered, unexpired,

and finally get the token data and compare it to request data.
Return User if valid or error if not

Types

This section is empty.

Jump to

Keyboard shortcuts

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