account

package
v0.0.0-...-c86d00c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeEmail

func ChangeEmail(db *gorm.DB) http.HandlerFunc

ChangeEmail saves a new entry to the database with the new email and a token

func ConfirmChangeEmail

func ConfirmChangeEmail(db *gorm.DB) http.HandlerFunc

ConfirmChangeEmail confirms the email change based on the saved entry

func DeleteAccount

func DeleteAccount(db *gorm.DB) http.HandlerFunc

DeleteAccount delete's all data associated with a user's id and the user itself

func Login

func Login(db *gorm.DB) http.HandlerFunc

Login handles the login process it expects a code query parameter checks if it's valid and matches everything then returns a token used for auth

func LoginUser

func LoginUser(db *gorm.DB) http.HandlerFunc

LoginUser is a handlers for login requests that returns the user token

func RegisterUser

func RegisterUser(db *gorm.DB, app *config.AppConfig) http.HandlerFunc

RegisterUser is a handler for registering a new user and sending an email confirmation

Types

type ChangeEmailRequest

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

type ConfirmChangeEmailRequest

type ConfirmChangeEmailRequest struct {
	Email       string `json:"email"`
	ChangeToken string `json:"token"`
}

type DeleteRequest

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

type LoginRequest

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

type RegisterRequest

type RegisterRequest struct {
	Email       string `json:"email"`
	CountryCode string `json:"country_code"`
}

Jump to

Keyboard shortcuts

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