Documentation ¶
Index ¶
- Constants
- func LoginHandler(db *sqlx.DB, cfg config.Config) http.HandlerFunc
- func LogoutHandler(secret string) http.HandlerFunc
- func OauthLoginHandler(db *sqlx.DB, cfg config.Config) http.HandlerFunc
- func RegisterUser(w http.ResponseWriter, r *http.Request)
- func ResetPassword(db *sqlx.DB, cfg config.Config) http.HandlerFunc
- func TokenLoginHandler(db *sqlx.DB, cfg config.Config) http.HandlerFunc
- func VerifyUrlOnWhiteList(urlString string, whiteListedUrls []string) (bool, error)
Constants ¶
const UpdateLoginTimeQuery = `` /* 148-byte string literal not displayed */
UpdateLoginTimeQuery is meant to only update the last_authenticated field once per minute in order to avoid row-locking when the same user logs in frequently.
Variables ¶
This section is empty.
Functions ¶
func LoginHandler ¶
LoginHandler first attempts to verify and parse user information from an optionally provided client TLS certificate. If it fails at any point, it will fall back and continue with the standard submitted form authentication.
func LogoutHandler ¶
func LogoutHandler(secret string) http.HandlerFunc
func OauthLoginHandler ¶
OauthLoginHandler accepts a JSON web token previously obtained from an OAuth provider, decodes it, validates it, authorizes the user against the database, and returns the login result as either an error or success message
func RegisterUser ¶
func RegisterUser(w http.ResponseWriter, r *http.Request)
RegisterUser is the handler for /users/register. It sends registration through Email.
func ResetPassword ¶
func TokenLoginHandler ¶
Types ¶
This section is empty.