Documentation ¶
Index ¶
- func HandleOAuth2Callback(w http.ResponseWriter, r *http.Request)
- func HandleOAuth2Login(w http.ResponseWriter, r *http.Request)
- func Init()
- func InitSM(sm *scs.SessionManager)
- func Logout(w http.ResponseWriter, r *http.Request)
- func SendUser(w http.ResponseWriter, r *http.Request)
- type Auth
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleOAuth2Callback ¶
func HandleOAuth2Callback(w http.ResponseWriter, r *http.Request)
HandleOAuth2Callback handles the OAuth2 Callback and get user info
func HandleOAuth2Login ¶
func HandleOAuth2Login(w http.ResponseWriter, r *http.Request)
HandleOAuth2Login handles the OAuth2 login
func InitSM ¶
func InitSM(sm *scs.SessionManager)
InitSM init the current package with the provided SCS session manager
Types ¶
type Auth ¶
Auth implements the qor Auth interface, and can be used in an admin (https://doc.getqor.com/admin/authentication.html, https://godoc.org/github.com/qor/admin#Auth)
func (Auth) GetCurrentUser ¶
func (a Auth) GetCurrentUser(c *admin.Context) qor.CurrentUser
GetCurrentUser returns the current user from the context
type User ¶
type User struct { Login string `json:"login"` FullName string `json:"displayName,omitempty"` MemberOf []string `json:"memberOf"` IsAdmin bool `json:"isAdmin"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` }
User struct implements the QOR qor.CurrentUser interface https://godoc.org/github.com/qor/qor#CurrentUser
func (User) IsMemberOf ¶
IsMemberOf checks if an user is a member of the given group
Click to show internal directories.
Click to hide internal directories.