Authentication code is in auth now
This commit is contained in:
parent
88614d412b
commit
4ab152d976
@ -1,4 +1,4 @@
|
|||||||
package main
|
package auth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
@ -1,11 +1,11 @@
|
|||||||
package main
|
package auth
|
||||||
|
|
||||||
import "github.com/aerogo/aero"
|
import "github.com/aerogo/aero"
|
||||||
|
|
||||||
// EnableLogin ...
|
// Install ...
|
||||||
func EnableLogin(app *aero.Application) {
|
func Install(app *aero.Application) {
|
||||||
// Google
|
// Google
|
||||||
EnableGoogleLogin(app)
|
InstallGoogleAuth(app)
|
||||||
|
|
||||||
// Logout
|
// Logout
|
||||||
app.Get("/logout", func(ctx *aero.Context) string {
|
app.Get("/logout", func(ctx *aero.Context) string {
|
@ -1,4 +1,4 @@
|
|||||||
package main
|
package auth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@ -25,8 +25,8 @@ type GoogleUser struct {
|
|||||||
Gender string `json:"gender"`
|
Gender string `json:"gender"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableGoogleLogin enables Google login for the app.
|
// InstallGoogleAuth enables Google login for the app.
|
||||||
func EnableGoogleLogin(app *aero.Application) {
|
func InstallGoogleAuth(app *aero.Application) {
|
||||||
conf := &oauth2.Config{
|
conf := &oauth2.Config{
|
||||||
ClientID: apiKeys.Google.ID,
|
ClientID: apiKeys.Google.ID,
|
||||||
ClientSecret: apiKeys.Google.Secret,
|
ClientSecret: apiKeys.Google.Secret,
|
3
main.go
3
main.go
@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/aerogo/aero"
|
"github.com/aerogo/aero"
|
||||||
"github.com/aerogo/api"
|
"github.com/aerogo/api"
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
|
"github.com/animenotifier/notify.moe/auth"
|
||||||
"github.com/animenotifier/notify.moe/components"
|
"github.com/animenotifier/notify.moe/components"
|
||||||
"github.com/animenotifier/notify.moe/layout"
|
"github.com/animenotifier/notify.moe/layout"
|
||||||
"github.com/animenotifier/notify.moe/middleware"
|
"github.com/animenotifier/notify.moe/middleware"
|
||||||
@ -66,7 +67,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Authentication
|
// Authentication
|
||||||
EnableLogin(app)
|
auth.Install(app)
|
||||||
|
|
||||||
// Let's go
|
// Let's go
|
||||||
app.Run()
|
app.Run()
|
||||||
|
Loading…
Reference in New Issue
Block a user