Make google authentication to ersteller-lib
This commit is contained in:
@@ -3,6 +3,7 @@ package routes
|
||||
import (
|
||||
. "ersteller-lib"
|
||||
"ersteller-lib/authentication"
|
||||
google_http "ersteller-lib/authentication/google/http"
|
||||
"ersteller-lib/starter/about"
|
||||
"ersteller-lib/starter/contact"
|
||||
"ersteller-lib/starter/ent"
|
||||
@@ -29,7 +30,12 @@ func CreateApi(environment env.Environment, db *ent.Client) http.Handler {
|
||||
sessionStore.Options.HttpOnly = true
|
||||
}
|
||||
|
||||
googleAuth := google.NewGoogleAuth(db, server.GetHttpServer(), environment, sessionStore)
|
||||
googleAuth := google_http.NewGoogleAuth(google.NewDatabase(db), server.GetHttpServer(), google_http.Environment{
|
||||
ClientId: environment.GoogleClientId,
|
||||
ClientSecret: environment.GoogleClientSecret,
|
||||
IsLocal: environment.IsLocal,
|
||||
BaseUrl: environment.BaseUrl,
|
||||
}, sessionStore)
|
||||
googleAuth.AddRoutes()
|
||||
|
||||
indexActivePath := NewActivePath(map[Language]string{
|
||||
@@ -83,7 +89,7 @@ func CreateApi(environment env.Environment, db *ent.Client) http.Handler {
|
||||
|
||||
serverWithMiddleWare := UseMiddleware(server, LoggingMiddleware, MakeGzipHandler,
|
||||
authentication.Middleware(sessionStore,
|
||||
[]string{"/de" + login.LoginPathDe, "/en" + authentication.LoginPath, google.GoogleLogin, google.GoogleLoginCallback, "/static"}, loginPaths))
|
||||
[]string{"/de" + login.LoginPathDe, "/en" + authentication.LoginPath, google_http.GoogleLogin, google_http.GoogleLoginCallback, "/static"}, loginPaths))
|
||||
|
||||
return serverWithMiddleWare
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user