auth

package
v0.0.0-...-02bf5d9 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptInvite

func AcceptInvite(ctx context.Context, db boil.ContextExecutor, s sender.Sender, invite *core.UserInvitation, username string, password string) error

func AddFlash

func AddFlash(c *gin.Context, flash interface{}, vars ...string)

func Auth

func Auth(c *gin.Context, db *sqlx.DB)

func AuthAPI

func AuthAPI(c *gin.Context, db *sqlx.DB)

func CheckCredentials

func CheckCredentials(c *gin.Context, db boil.ContextExecutor, email string, password string) error

func EnforceAuth

func EnforceAuth(c *gin.Context)

func EnforceReferer

func EnforceReferer(c *gin.Context)

func GetFlashes

func GetFlashes(c *gin.Context, vars ...string) []interface{}

func HashValue

func HashValue(v string) string

func Login

func Login(c *gin.Context, db boil.ContextExecutor, email string, password string) error

func Logout

func Logout(c *gin.Context)

func RedirectToLogin

func RedirectToLogin(c *gin.Context)

func Signup

func Signup(ctx context.Context, db boil.ContextExecutor, sender sender.Sender, email string, username, password string, attribution string) (*core.User, error)

Signup assumes the transaction is already began

Types

type UserData

type UserData struct {
	User       *pgsession.User
	DBUser     *core.User
	IsLoggedIn bool
	CSRFToken  string
}

func GetAPIUserData

func GetAPIUserData(c *gin.Context) UserData

this is a lame way of doing the auth. Ideally the controller code should simply read the user from the context and that's it

func GetUserData

func GetUserData(c *gin.Context) UserData

Jump to

Keyboard shortcuts

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