20 lines
383 B
Go
Raw Normal View History

2017-06-11 09:13:59 +00:00
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())
}
})
}