auth

package
v0.0.0-...-fcd840d Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Controller = authHandler()
View Source
var GetAuthUser = &getAuthUser{db: &db.Instance}
View Source
var LogIn = &logIn{db: &db.Instance}
View Source
var LogOut = &logOut{db: &db.Instance}
View Source
var Refresh = &refresh{db: &db.Instance}
View Source
var ResetPassword = &resetPassword{db: &db.Instance}
View Source
var SignUp = &signUp{db: &db.Instance}
View Source
var UpdatePassword = &updatePassword{db: &db.Instance}
View Source
var VerifySignup = &verifySignup{db: &db.Instance}

Functions

func Guard

func Guard(next http.Handler) http.Handler

func Headers

func Headers(r *http.Request) (string, string)

Types

type LogInDto

type LogInDto struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResult

type LoginResult struct {
	User        UserData `json:"user"`
	AccessToken string   `json:"accessToken"`
}

type Message

type Message struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
}

Status message of a sent mail

type ReCaptchaResponse

type ReCaptchaResponse struct {
	Success     bool         `json:"success"`
	ChallengeTs string       `json:"challenge_ts"`
	Hostname    string       `json:"hostname"`
	ErrorCodes  *interface{} `json:"error-codes"`
}

type RefreshResult

type RefreshResult struct {
	AccessToken string `json:"accessToken"`
}

type ResetPasswordDto

type ResetPasswordDto struct {
	Email string `json:"email"`
}

type SignUpCode

type SignUpCode struct {
	Code int `json:"code"`
}

type SignUpData

type SignUpData struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Code     int    `json:"code"`
}

type SignUpDto

type SignUpDto struct {
	Email      string  `json:"email"`
	Password   string  `json:"password"`
	Grecaptcha *string `json:"grecaptcha"`
}

type SignUpResult

type SignUpResult struct {
	User        UserData `json:"user"`
	AccessToken string   `json:"accessToken"`
}

type UpdatePasswordDto

type UpdatePasswordDto struct {
	Password string `json:"password"`
	Token    string `json:"token"`
}

type UserData

type UserData struct {
	ID        *int       `json:"id"`
	Email     *string    `json:"email"`
	FirstName *string    `json:"firstName"`
	LastName  *string    `json:"lastName"`
	Phone     *string    `json:"phone"`
	Avatar    *string    `json:"avatar"`
	Access    *string    `json:"access"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

-- User ------------------------------------------------------------------------

type UserPswd

type UserPswd struct {
	PasswordHash string
	UserId       int
}

Jump to

Keyboard shortcuts

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