Authentication code is in auth now

This commit is contained in:
Eduard Urbach 2017-06-17 01:32:47 +02:00
parent 88614d412b
commit 4ab152d976
4 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
package main
package auth
import (
"encoding/json"

View File

@ -1,11 +1,11 @@
package main
package auth
import "github.com/aerogo/aero"
// EnableLogin ...
func EnableLogin(app *aero.Application) {
// Install ...
func Install(app *aero.Application) {
// Google
EnableGoogleLogin(app)
InstallGoogleAuth(app)
// Logout
app.Get("/logout", func(ctx *aero.Context) string {

View File

@ -1,4 +1,4 @@
package main
package auth
import (
"encoding/json"
@ -25,8 +25,8 @@ type GoogleUser struct {
Gender string `json:"gender"`
}
// EnableGoogleLogin enables Google login for the app.
func EnableGoogleLogin(app *aero.Application) {
// InstallGoogleAuth enables Google login for the app.
func InstallGoogleAuth(app *aero.Application) {
conf := &oauth2.Config{
ClientID: apiKeys.Google.ID,
ClientSecret: apiKeys.Google.Secret,

View File

@ -4,6 +4,7 @@ import (
"github.com/aerogo/aero"
"github.com/aerogo/api"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/auth"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/layout"
"github.com/animenotifier/notify.moe/middleware"
@ -66,7 +67,7 @@ func main() {
}
// Authentication
EnableLogin(app)
auth.Install(app)
// Let's go
app.Run()