Move google client id to config
Errietta Kostala [Wed, 21 Jan 2015 17:12:23 +0000 (17:12 +0000)]
lib/stemmaweb/Controller/Users.pm
root/src/auth/login.tt
stemmaweb.conf

index 38c8d48..1e87b37 100644 (file)
@@ -67,6 +67,8 @@ before login => sub {
   if ($c->req->params->{email} && $c->req->params->{id_token}) {
     $c->req->param( realm => 'google');
   }
+
+  $c->stash->{google_client_id} = $c->config->{'Authentication::Credential::Google'}->{client_id};
 };
 
 =head2 register with recaptcha
index fd60478..8ea317b 100644 (file)
@@ -82,7 +82,7 @@ $(document).ready(function() {
                        <span
                        class="g-signin"
                        data-callback="googleSignIn"
-                       data-clientid="577442226093-pi2ud795g49ibip78bgfoabhl4kdrguc.apps.googleusercontent.com"
+                       data-clientid="[% google_client_id %]"
                        data-cookiepolicy="single_host_origin"
                        data-requestvisibleactions="http://schema.org/AddAction"
                        data-scope="https://www.googleapis.com/auth/plus.profile.emails.read"
index 8857908..3bfed71 100644 (file)
@@ -12,4 +12,5 @@ name = stemmaweb
 </Model>
 <Authentication::Credential::Google>
     public_cert_url https://www.googleapis.com/oauth2/v1/certs
+    client_id 577442226093-pi2ud795g49ibip78bgfoabhl4kdrguc.apps.googleusercontent.com
 </Authentication::Credential::Google>