Skip to content

Instantly share code, notes, and snippets.

@arbarlow
Created April 23, 2015 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arbarlow/053dafa66ae87f54aefb to your computer and use it in GitHub Desktop.
Save arbarlow/053dafa66ae87f54aefb to your computer and use it in GitHub Desktop.
func AuthenticateUser(session sessions.Session, db gorm.DB, c martini.Context, r render.Render) {
user := FetchUser(session, db)
if user.ID != "" {
c.Map(user)
return
}
r.Error(http.StatusUnauthorized)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment