auth

package
v0.0.0-...-4185ac2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(hash, password []byte) bool

Compare takes a []byte password and hash compares and returns true for match

func CreateSession

func CreateSession(col *database.Collection, userID primitive.ObjectID) (string, error)

CreateSession creates a session and stores into database

func Hash

func Hash(password []byte) ([]byte, error)

Hash takes pwd []byte and returns hash type []byte

func ValidateSession

func ValidateSession(seshCol *database.Collection, userCol *database.Collection,
	key string) (*objects.User, error)

ValidateSession finds the session key, returns true if it exists

Types

This section is empty.

Jump to

Keyboard shortcuts

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