auth

package
v0.0.0-...-7daae65 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAuth = &AuthMethod{
	ID:         1,
	TTL:        6000,
	RefreshTTL: 3600,
}

Functions

This section is empty.

Types

type AuthMethod

type AuthMethod struct {
	ID         int
	TTL        int // minutes to refresh
	RefreshTTL int
}

func GetAuthMethod

func GetAuthMethod(ID int) *AuthMethod

type AuthenticationMatrix

type AuthenticationMatrix struct {
	models.BaseModelSoftDelete
	UserID       int        `gorm:"not null;index:user_auth_matrix_idx" db:"user_id"`
	User         user.User  `gorm:"-"`
	AuthMethodID int        `gorm:"not null" db:"auth_method_id"`
	AuthMethod   AuthMethod `gorm:"-"`
	Token        string     `gorm:"not null" db:"token"`
}

func (*AuthenticationMatrix) BeforeCreate

func (toCreate *AuthenticationMatrix) BeforeCreate(db *gorm.DB) (err error)

func (*AuthenticationMatrix) Create

func (toCreate *AuthenticationMatrix) Create(db *gorm.DB) (*gorm.DB, error)

Jump to

Keyboard shortcuts

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