gauth

package
v0.0.0-...-c84c7a3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoogleOauthConfig = &oauth2.Config{
	RedirectURL:  os.Getenv("POST-AUTH-REDIRECT-URL"),
	ClientID:     os.Getenv("GOOGLE-OAUTH-CLIENT-ID"),
	ClientSecret: os.Getenv("GOOGLE-OAUTH-CLIENT-SECRET"),
	Scopes:       []string{"profile", "email"},
	Endpoint:     google.Endpoint,
}

Functions

func AddUserSession

func AddUserSession(session userSession)

func ExistsUserSession

func ExistsUserSession(sessionID string) bool

func GetCookieValueByName

func GetCookieValueByName(cookie []*http.Cookie, name string) string

func GetUserIDFromSessionID

func GetUserIDFromSessionID(sessionID string) (int64, error)

func LoggedInHandler

func LoggedInHandler(w http.ResponseWriter, r *http.Request) HTTPErrors.Error

func LoginHandler

func LoginHandler(w http.ResponseWriter, r *http.Request) HTTPErrors.Error

func LogoutHandler

func LogoutHandler(w http.ResponseWriter, r *http.Request) HTTPErrors.Error

func OauthCallBackHandler

func OauthCallBackHandler(w http.ResponseWriter, r *http.Request) HTTPErrors.Error

Types

This section is empty.

Jump to

Keyboard shortcuts

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