auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(bytes int) (string, error)

GenerateToken returns a cryptographically random hex string of the given byte length. Used by OAuth state and session token generation.

Types

type Identity

type Identity struct {
	UserID int64
	Email  string
	Method MethodType
}

Identity represents a verified user from any auth method.

type MethodType

type MethodType string

MethodType identifies how a user proved their identity.

const (
	MethodOTP   MethodType = "otp"
	MethodOAuth MethodType = "oauth"
)

type Session

type Session struct {
	Token     string
	UserID    int64
	Email     string
	Method    MethodType
	ExpiresAt time.Time
}

Session represents an active authenticated session.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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