Пример #1
0
func (a *ContextAuthenticator) UserID(request *http.Request) string {
	return context.Load(request).UserId
}
Пример #2
0
func (a *ContextAuthenticator) SetUserID(writer http.ResponseWriter, request *http.Request, userId string) {
	var ctx = context.Load(request)
	ctx.UserId = userId
	ctx.Save(request)
}
Пример #3
0
func (a *ContextAuthenticator) IsAuthenticated(request *http.Request) bool {
	return context.Load(request).IsAuthenticated()
}