Documentation ¶
Index ¶
- Constants
- Variables
- func AuthMiddleware(next http.Handler, db *sql.DB) http.Handler
- func ExchangeHandler(w http.ResponseWriter, r *http.Request, c *oauth2.Config, d *sql.DB)
- func InitializeUserTable(db *sql.DB)
- func LoginHandler(w http.ResponseWriter, r *http.Request, c *oauth2.Config, p Provider)
- func RedirectHandler(w http.ResponseWriter, r *http.Request, p Provider)
- type Provider
Constants ¶
View Source
const OAUTH_STATE_LENGTH = 64
View Source
const SESSION_COOKIE_TTL = 60 // minutes
View Source
const SESSION_TOKEN_LENGTH = 256
Variables ¶
View Source
var LoginPage []byte
Functions ¶
func ExchangeHandler ¶
func InitializeUserTable ¶
func LoginHandler ¶
func RedirectHandler ¶
func RedirectHandler(w http.ResponseWriter, r *http.Request, p Provider)
Browsers may not include cookies on HTTP redirects. To address this, we can return an HTML redirect first. https://stackoverflow.com/questions/57026956/on-safari-cookies-are-not-saved-when-sent-with-redirect https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections#html_redirections
Types ¶
Click to show internal directories.
Click to hide internal directories.