This commit is contained in:
2017-06-11 11:13:59 +02:00
parent 22f75038f5
commit 3a7a9dea65
7 changed files with 62 additions and 47 deletions

19
login.go Normal file
View File

@ -0,0 +1,19 @@
package main
import "github.com/aerogo/aero"
func init() {
// Authentication
EnableGoogleLogin(app)
// Session middleware
app.Use(func(ctx *aero.Context, next func()) {
// Handle the request first
next()
// Update session if it has been modified
if ctx.HasSession() && ctx.Session().Modified() {
app.Sessions.Store.Set(ctx.Session().ID(), ctx.Session())
}
})
}