controllers

package
v0.0.0-...-4c6bba2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallbackHandler

func CallbackHandler() gin.HandlerFunc

CallbackHandler parse state and code in order to sign in

func GitHub

func GitHub(c *gin.Context)

GitHub redirects github sign in page

func GitHubCallback

func GitHubCallback(c *gin.Context)

GitHubCallback registers user info @Description try register github info @Summary try register github info @Param state query string true "state" @Param code query string true "code" @Failure 503 {string} string "no OAuth token"

func Google

func Google(c *gin.Context)

Google redirects google sign in page

func GoogleCallback

func GoogleCallback(c *gin.Context)

GoogleCallback registers user info @Param state query string true "state" @Param code query string true "code" @Failure 503 {string} string "no OAuth token"

func Index

func Index(c *gin.Context)

Index returns html containing under maintanance or not

func InitController

func InitController(a *auth.Auther)

InitController loads config

func OAuthHandler

func OAuthHandler() gin.HandlerFunc

OAuthHandler handles redirect or error page It views error page when keyErr is set It redirects OAuth sites when keyRedirect is set

func RegisterHandler

func RegisterHandler() gin.HandlerFunc

RegisterHandler sends back jwt token to client It should be called after CallbackHandler is called

func Twitter

func Twitter(c *gin.Context)

Twitter redirects twitter sign in page

func TwitterCallback

func TwitterCallback(c *gin.Context)

TwitterCallback registers user info @Param oauth_verifier query string true "access token" @Failure 503 {string} string "session expire" @Failure 503 {string} string "no OAuth token"

Types

type CallbackFunc

type CallbackFunc func(string, string) (*auth.OAuthInfo, error)

CallbackFunc return auth information depending on each service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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