Documentation ¶
Index ¶
- func ChangeEmail(db *gorm.DB) http.HandlerFunc
- func ConfirmChangeEmail(db *gorm.DB) http.HandlerFunc
- func DeleteAccount(db *gorm.DB) http.HandlerFunc
- func Login(db *gorm.DB) http.HandlerFunc
- func LoginUser(db *gorm.DB) http.HandlerFunc
- func RegisterUser(db *gorm.DB, app *config.AppConfig) http.HandlerFunc
- type ChangeEmailRequest
- type ConfirmChangeEmailRequest
- type DeleteRequest
- type LoginRequest
- type RegisterRequest
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 ¶
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 DeleteRequest ¶
type DeleteRequest struct {
Email string `json:"email"`
}
type LoginRequest ¶
type LoginRequest struct {
Email string `json:"email"`
}
type RegisterRequest ¶
Click to show internal directories.
Click to hide internal directories.