Skip to content
Grav 2.0 is officially stable. Read the announcement →
Plugins

Oauth2 Google integration

Started by Remi Prouteau 5 years ago · 3 replies · 501 views
5 years ago

Hi,

I am current trying the Oauth2 plugin with an authentication on Google.
When configured I can see that on the login page, I have the choice between Google auth and the basic form authentication. I would like to know if there is any way to have only the google authentication listed?

Also I tried to add some Javascript to the login page so the google auth is automatically selected, but my customization is replaced after each update of the plugin. Is there any way to have that kind of customization survive an update? Maybe I should do it somewhere else than the login.html.twig file?

5 years ago

Hello Remi,

I don't know about your first question, but to make changes in an update-safe way you should always copy the template you're modifying to your own theme folder (keeping the folder structure intact). The templates in your own theme take precedence over those provided by Grav or by a plugin.

So in your case, just copy user/plugins/login/templates/login.html.twig to user/themes/YOURTHEME/templates/login.html.twig, and you should be good to go!

last edited 05/01/21 by Anna
5 years ago

@Netzhexe:
user/themes/YOURTHEME/login/templates/login.html.twig

I don't think there should be a /login part

5 years ago

You are RIGHT I'm correcting this 😅

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 75 1 week ago
Plugins · by Xavier, 4 weeks ago
2 81 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1208 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 75 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 99 2 months ago