Documentation
¶
Overview ¶
Package auth provides the functions needed to get a user information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // KOfflineMode allows the set the offline mode KOfflineMode bool )
Functions ¶
func CheckAuthenticationData ¶
CheckAuthenticationData checks if authorization information in HTTP.Request is valid, ie: if it matches a user.
func CheckUserValidity ¶
CheckUserValidity checks user validity from an accessToken string. verify if google user account is valid.
func CurrentOfflineUser ¶
CurrentOfflineUser returns pointer to current user, from authentication cookie.
func IsGonawinAdmin ¶
IsGonawinAdmin checks if user is gonawin admin.
Types ¶
type TwitterUserInfo ¶
type TwitterUserInfo struct { Id int64 `json:"id,omitempty"` Name string ScreenName string `json:"screen_name,omitempty"` }
TwitterUserInfo represents the twitter data needed for authentication.
func FetchTwitterUserInfo ¶
func FetchTwitterUserInfo(r *http.Response) (*TwitterUserInfo, error)
FetchTwitterUserInfo unmarshals twitter response
type UserInfo ¶
UserInfo represents the user infor needed for authentication.
func GetUserGoogleInfo ¶
GetUserGoogleInfo returns user information from Google Accounts user. If on development server only email (example@example.com) will be present. So Id and Name will be added.