Implemented new user registrations

This commit is contained in:
2017-06-22 22:26:52 +02:00
parent cf0d47bfb0
commit efe8a36b7a
6 changed files with 105 additions and 31 deletions

View File

@ -1,6 +1,7 @@
package auth
import "github.com/aerogo/aero"
import "github.com/animenotifier/notify.moe/utils"
// Install ...
func Install(app *aero.Application) {
@ -10,6 +11,12 @@ func Install(app *aero.Application) {
// Logout
app.Get("/logout", func(ctx *aero.Context) string {
if ctx.HasSession() {
user := utils.GetUser(ctx)
if user != nil {
authLog.Info("User logged out", user.ID, ctx.RealIP(), user.Email, user.RealName())
}
ctx.Session().Set("userId", nil)
}