19 lines
298 B
Go
Raw Normal View History

2017-06-17 01:32:47 +02:00
package auth
2017-06-11 11:13:59 +02:00
import "github.com/aerogo/aero"
2017-06-17 01:32:47 +02:00
// Install ...
func Install(app *aero.Application) {
2017-06-15 19:56:09 +02:00
// Google
2017-06-17 01:32:47 +02:00
InstallGoogleAuth(app)
2017-06-11 11:13:59 +02:00
2017-06-15 21:59:14 +02:00
// Logout
app.Get("/logout", func(ctx *aero.Context) string {
2017-06-17 22:19:26 +02:00
if ctx.HasSession() {
ctx.Session().Set("userId", nil)
}
2017-06-15 21:59:14 +02:00
return ctx.Redirect("/")
})
2017-06-11 11:13:59 +02:00
}