Authentication code is in auth now
This commit is contained in:
parent
88614d412b
commit
4ab152d976
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package auth
|
||||
|
||||
import (
|
||||
"encoding/json"
|
@ -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 {
|
@ -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,
|
3
main.go
3
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()
|
||||
|
Loading…
Reference in New Issue
Block a user