routes

package
v0.0.0-...-17ed6e2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorization

func Authorization(next http.Handler) http.Handler

Authorization ensures that requests contain a valid JWT token.

func Dashboard

func Dashboard(w http.ResponseWriter, r *http.Request)

Dashboard renders the dashboard page.

func Forgot

func Forgot(w http.ResponseWriter, r *http.Request)

Forgot renders the forgot password page.

func ForgotPost

func ForgotPost(w http.ResponseWriter, r *http.Request)

ForgotPost handles forgot password requests.

func Logout

func Logout(w http.ResponseWriter, r *http.Request)

Logout removes the stored token and redirects to the sign in page.

func NoAuthorization

func NoAuthorization(next http.Handler) http.Handler

NoAuthorization ensures that requests do not contain valid JWT tokens.

func Serve

func Serve()

Serve starts the HTTP server. If any errors occur, Serve panics.

func ServeFiles

func ServeFiles(router chi.Router)

ServeFiles starts a http.FileServer to serve static files from public.

func SignIn

func SignIn(w http.ResponseWriter, r *http.Request)

SignIn renders the sign in page.

func SignInPost

func SignInPost(w http.ResponseWriter, r *http.Request)

SignInPost handles sign in requests.

Types

type AuthenticationClaims

type AuthenticationClaims struct {
	ID uint64 `json:"id"`
	jwt.StandardClaims
}

AuthenticationClaims holds JWT claims information.

Jump to

Keyboard shortcuts

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