Cleanup
This commit is contained in:
19
login.go
Normal file
19
login.go
Normal 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())
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user