auth

package
v0.0.0-...-3e9567e Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessToken

func AccessToken(id string, school string) (string, error)

func ActiveAccessToken

func ActiveAccessToken(ctx context.Context) string

func ActiveRefreshToken

func ActiveRefreshToken(ctx context.Context) string

func RefreshToken

func RefreshToken(id string, school string) (string, error)

func VerifyAccessToken

func VerifyAccessToken(tokenStr string) (jwt.MapClaims, error)

func VerifyRefreshToken

func VerifyRefreshToken(tokenStr string) (jwt.MapClaims, error)

Types

type App

type App interface {
	Login(ctx context.Context, email string, password string) (*ddd.Response[Domain], error)
	Access(ctx context.Context) (*ddd.Response[Domain], error)
	Me(ctx context.Context) (*ddd.Response[User], error)
}

type Args

type Args struct {
	Aggregation ddd.AggregationArgs
	Refresh     string
}

type Domain

type Domain struct {
	// contains filtered or unexported fields
}

func Existing

func Existing(refresh string) (*Domain, error)

func New

func New(id string, school string) (*Domain, error)

func (*Domain) Access

func (d *Domain) Access() string

func (*Domain) Refresh

func (d *Domain) Refresh() string

type User

type User struct {
	Id         string
	GivenNames string
	FamilyName string
	Phone      int
	Email      string
	Role       core.Reference
	School     string
	State      string
}

func ActiveUser

func ActiveUser(ctx context.Context, key string) *User

Jump to

Keyboard shortcuts

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