auth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const XGlueAuthentication = "X-Glue-Authentication"

Variables

View Source
var ErrUnauthorized = errors.New("unauthorized")

Functions

func Require

func Require(next box.H) box.H

Require the user is authenticated

func SetAuth

func SetAuth(ctx context.Context, a *Auth) context.Context

Types

type Auth

type Auth struct {
	Session struct {
		ID string `json:"id"`
	} `json:"session"`
	User User `json:"user"`
}

func GetAuth

func GetAuth(ctx context.Context) *Auth

type User

type User struct {
	ID      string `json:"id"`
	Nick    string `json:"nick"`
	Picture string `json:"picture"`
	Email   string `json:"email"`
}

Jump to

Keyboard shortcuts

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