Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialise ¶
func Initialise(handler RequestHandler) error
Initialise initialises the oauth router.
Types ¶
type RequestHandler ¶
type RequestHandler interface { // Checks whether the user is logged in. If they are, it returns true. Otherwise, it redirects // the user to the login page. CheckLoggedInOrRedirect(c *gin.Context) bool // DisplayAuthorizePage renders the page where the user can validate the request for authorization DisplayAuthorizePage(client Client, c *gin.Context) // CheckCSRF is a function that checks the POSTed parameter `csrf` is valid. CheckCSRF(c *gin.Context, s string) bool // GetDB retrieves MySQL's DB. GetDB() *sql.DB // GetUserID retrieves the ID of the currently logged in user. GetUserID(c *gin.Context) int }
RequestHandler contains the functions to which Oauth will delegate.
Click to show internal directories.
Click to hide internal directories.