errors

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound is returned when a user is not found
	ErrUserNotFound = errors.New("user not found")
	// ErrInvalidCredentials is returned when credentials are invalid
	ErrInvalidCredentials = errors.New("invalid credentials")
	// ErrUserExists is returned when a user already exists
	ErrUserExists = errors.New("user already exists")
	// ErrInvalidToken is returned when a token is invalid
	ErrInvalidToken = errors.New("invalid token")
	// ErrTokenExpired is returned when a token has expired
	ErrTokenExpired = errors.New("token expired")
	// ErrPermissionDenied is returned when a user doesn't have required permissions
	ErrPermissionDenied  = errors.New("permission denied")
	ErrUnsupportedMethod = errors.New("unsupported_method")
	ErrUserDisabled      = errors.New("user account is disabled")
	ErrPasswordMismatch  = errors.New("password mismatch")
	ErrInvalidPassword   = errors.New("invalid password")
	ErrInvalidEmail      = errors.New("invalid email")
	ErrInvalidUsername   = errors.New("invalid username")
	ErrProviderRequired  = errors.New("provider required")

	ErrInvalidOrExpiredToken = errors.New("invalid or expired token")
	ErrInvalidTokenClaims    = errors.New("invalid token claims")
	ErrInvalidTokenUser      = errors.New("invalid token user")

	// Social Account unique constraint errors
	ErrSocialEmailDoesNotExist = errors.New("social email is not linked for user")
	ErrProviderUserIDExists    = errors.New("provider user id already exists")
	ErrUserIDExists            = errors.New("user id already linked to a social account")
	ErrSocialEmailExists       = errors.New("email already linked to this provider")
)

Functions

func IsAuthError

func IsAuthError(err error, code string) bool

IsAuthError checks if an error is an authentication error with a specific code

Types

type AuthError

type AuthError struct {
	Code    string
	Message string
}

AuthError represents an authentication error

func NewAuthError

func NewAuthError(code string, message string) *AuthError

NewAuthError creates a new authentication error

func (*AuthError) Error

func (e *AuthError) Error() string

Error implements the error interface

Jump to

Keyboard shortcuts

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