Documentation ¶
Index ¶
- func EmailPage(w http.ResponseWriter, r *http.Request)
- func PasswordPage(w http.ResponseWriter, r *http.Request)
- func UpdateEmail(w http.ResponseWriter, r *http.Request)
- func UpdatePassword(w http.ResponseWriter, r *http.Request)
- func UpdateUserEmail(db *sql.DB, newEmail string, username string) error
- func UpdateUserPassword(db *sql.DB, newPassword string, username string) error
- func UserPage(w http.ResponseWriter, r *http.Request)
- type PageData
- type UserPageData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmailPage ¶
func EmailPage(w http.ResponseWriter, r *http.Request)
EmailPage endpoint displays the users email and adds a possibility to update the email.
func PasswordPage ¶
func PasswordPage(w http.ResponseWriter, r *http.Request)
PasswordPage endpoint is a page with an empty form for updating the username. Note: Cannot be served as a static HTML page since we still need some data like username.
func UpdateEmail ¶
func UpdateEmail(w http.ResponseWriter, r *http.Request)
UpdateEmail endpoint parses the data from the form page and updates the email in the database.
func UpdatePassword ¶
func UpdatePassword(w http.ResponseWriter, r *http.Request)
UpdatePassword parses the password form and insert the new password in the database, hashed.
func UpdateUserEmail ¶
UpdateUserEmail updates the users email in the database based on the username.
func UpdateUserPassword ¶
UpdateUserPassword takes the raw password string and hashes it with BCrypt and inserts the new password into the database.
Types ¶
type PageData ¶
type PageData struct { User UserPageData Paths []helpers.Path }
PageData struct is used for the data being rendered and should not be used in other structs.
type UserPageData ¶
UserPageData stored all of the data connected to the user for the profile and setting pages.
func GetUserSettings ¶
GetUserSettings gets all of the user settings from the database based on the username.