diff --git a/api-keys.go b/auth/api-keys.go similarity index 97% rename from api-keys.go rename to auth/api-keys.go index a79088c9..5ac9938b 100644 --- a/api-keys.go +++ b/auth/api-keys.go @@ -1,4 +1,4 @@ -package main +package auth import ( "encoding/json" diff --git a/login.go b/auth/auth.go similarity index 64% rename from login.go rename to auth/auth.go index fdbadb18..c1777ecd 100644 --- a/login.go +++ b/auth/auth.go @@ -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 { diff --git a/google.go b/auth/google.go similarity index 95% rename from google.go rename to auth/google.go index 10ce5f35..71ce6332 100644 --- a/google.go +++ b/auth/google.go @@ -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, diff --git a/main.go b/main.go index 84ca0351..388cd7e8 100644 --- a/main.go +++ b/main.go @@ -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()