Changeset bbf9d1a in Klonkt for src/views/pages/admin-google.ejs
- Timestamp:
- 06/21/2026 02:32:39 PM (3 months ago)
- Branches:
- main
- Children:
- 4885eab
- Parents:
- 929d98d
- File:
-
- 1 edited
-
src/views/pages/admin-google.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/admin-google.ejs
r929d98d rbbf9d1a 1 1 <div class="container admin-page"> 2 <h1> Google-login</h1>3 <p><a href="/admin/settings" class="btn">← Instellingen</a></p>2 <h1><%= t('agoog.title') %></h1> 3 <p><a href="/admin/settings" class="btn">← <%= t('agoog.back') %></a></p> 4 4 5 5 <% if (success) { %><div class="alert alert-success"><%= success %></div><% } %> … … 7 7 8 8 <section class="set-card"> 9 <h2> Google-login (bezoekers)</h2>10 <p class="set-help"> Laat bezoekers met Google inloggen om te reageren — met je <strong>eigen</strong>11 Google Cloud-client. Maak er een aan op9 <h2><%= t('agoog.card_title') %></h2> 10 <p class="set-help"><%= t('agoog.card_help_pre') %> <strong><%= t('agoog.card_help_own') %></strong> 11 <%= t('agoog.card_help_mid') %> 12 12 <a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener">console.cloud.google.com</a> 13 (OAuth client-ID, type "Web application").14 <% if (google && google.configured) { %><strong> Status: ingesteld ✓</strong><% } else { %>Nog niet ingesteld.<% } %></p>13 <%= t('agoog.card_help_post') %> 14 <% if (google && google.configured) { %><strong><%= t('agoog.status_set') %></strong><% } else { %><%= t('agoog.status_unset') %><% } %></p> 15 15 16 16 <details class="set-google-guide"> 17 <summary> Hoe stel ik dit in? (stap voor stap)</summary>17 <summary><%= t('agoog.guide_summary') %></summary> 18 18 <ol class="set-google-steps"> 19 <li> Ga naar de <a href="https://console.cloud.google.com/" target="_blank" rel="noopener">Google Cloud Console</a> en maak (of kies) een project.</li>20 <li><strong>APIs & Services → OAuth consent screen</strong>: User type <strong>External</strong>. Voeg de scopes <code>email</code>, <code>profile</code> en <code>openid</code> toe. (In testmodus: voeg jezelf toe als testgebruiker.)</li>21 <li><strong>APIs & Services → Credentials → Create credentials → OAuth client ID</strong>, type<strong>Web application</strong>.</li>22 <li> Bij <strong>Authorized redirect URIs</strong>: plak de redirect-URI hieronder (moet <strong>exact</strong> matchen).</li>23 <li> Kopieer de <strong>Client ID</strong> + <strong>Client Secret</strong> die je krijgt naar de velden hieronder en klik Opslaan.</li>19 <li><%= t('agoog.step1_pre') %> <a href="https://console.cloud.google.com/" target="_blank" rel="noopener">Google Cloud Console</a> <%= t('agoog.step1_post') %></li> 20 <li><strong>APIs & Services → OAuth consent screen</strong>: <%= t('agoog.step2_usertype') %> <strong>External</strong>. <%= t('agoog.step2_scopes_pre') %> <code>email</code>, <code>profile</code> <%= t('agoog.step2_scopes_and') %> <code>openid</code> <%= t('agoog.step2_scopes_post') %> <%= t('agoog.step2_testmode') %></li> 21 <li><strong>APIs & Services → Credentials → Create credentials → OAuth client ID</strong>, <%= t('agoog.step3_type') %> <strong>Web application</strong>.</li> 22 <li><%= t('agoog.step4_pre') %> <strong>Authorized redirect URIs</strong><%= t('agoog.step4_post') %></li> 23 <li><%= t('agoog.step5_pre') %> <strong>Client ID</strong> + <strong>Client Secret</strong> <%= t('agoog.step5_post') %></li> 24 24 </ol> 25 <p class="set-help" style="margin:.5rem 0 0"><strong> Let op:</strong> je hoeft <strong>geen API's aan te zetten</strong> — "Google Cloud APIs", People API e.d. zijn <em>niet</em> nodig. Inloggen werkt via OpenID Connect (alleen het toestemmingsscherm + de OAuth-client).</p>25 <p class="set-help" style="margin:.5rem 0 0"><strong><%= t('agoog.note_label') %></strong> <%= t('agoog.note_pre') %> <strong><%= t('agoog.note_noapi') %></strong> <%= t('agoog.note_mid') %> <em><%= t('agoog.note_not') %></em> <%= t('agoog.note_post') %></p> 26 26 </details> 27 27 28 28 <% if (google && google.redirectUri) { %> 29 29 <div class="set-redirect"> 30 <div class="set-redirect-label"> Redirect-URI — kopieer deze en plak 'm in Google</div>30 <div class="set-redirect-label"><%= t('agoog.redirect_label') %></div> 31 31 <code class="set-redirect-url" style="user-select:all"><%= google.redirectUri %></code> 32 32 <ol class="set-redirect-steps"> 33 <li> Ga naar<a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener">Google Cloud Console → APIs & Services → Credentials</a>.</li>34 <li> Open jouw <strong>OAuth client-ID</strong> (type "Web application").</li>35 <li> Onder <strong>Authorized redirect URIs</strong> → klik <strong>+ ADD URI</strong> en plak de regel hierboven.</li>36 <li> Klik <strong>Save</strong> en wacht ~1 minuut.</li>33 <li><%= t('agoog.rstep1_pre') %> <a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener">Google Cloud Console → APIs & Services → Credentials</a>.</li> 34 <li><%= t('agoog.rstep2') %></li> 35 <li><%= t('agoog.rstep3_pre') %> <strong>Authorized redirect URIs</strong> → <%= t('agoog.rstep3_mid') %> <strong>+ ADD URI</strong> <%= t('agoog.rstep3_post') %></li> 36 <li><%= t('agoog.rstep4_pre') %> <strong>Save</strong> <%= t('agoog.rstep4_post') %></li> 37 37 </ol> 38 <p class="set-redirect-warn"> Moet <strong>exact</strong> kloppen: <code>https://</code> (geen <code>http</code>), juiste domein, en <strong>geen</strong> schuine streep aan het eind. Anders krijg je <em>"Error 400: redirect_uri_mismatch"</em>.</p>38 <p class="set-redirect-warn"><%= t('agoog.warn_pre') %> <strong><%= t('agoog.warn_exact') %></strong> <%= t('agoog.warn_mid1') %> <code>https://</code> (<%= t('agoog.warn_nohttp') %> <code>http</code>)<%= t('agoog.warn_mid2') %> <strong><%= t('agoog.warn_noslash') %></strong> <%= t('agoog.warn_mid3') %> <em><%= t('agoog.warn_error') %></em>.</p> 39 39 </div> 40 40 <% } else { %> 41 <p class="set-help" style="color:var(--accent)"> Stel eerst <code>PUBLIC_BASE_URL</code> in — daar wordt de redirect-URI van afgeleid.</p>41 <p class="set-help" style="color:var(--accent)"><%= t('agoog.set_baseurl_pre') %> <code>PUBLIC_BASE_URL</code> <%= t('agoog.set_baseurl_post') %></p> 42 42 <% } %> 43 43 44 44 <form method="post" action="/admin/settings/google" class="set-form"> 45 45 <label class="set-field"> 46 <span> Client ID</span>46 <span><%= t('agoog.client_id') %></span> 47 47 <input type="text" name="google_client_id" value="<%= google ? google.clientId : '' %>" placeholder="123-abc.apps.googleusercontent.com" autocomplete="off"> 48 48 </label> 49 49 <label class="set-field"> 50 <span> Client Secret <% if (google && google.secretSet) { %><small style="font-weight:400">— ingesteld; leeg laten = ongewijzigd</small><% } %></span>51 <input type="password" name="google_client_secret" placeholder="<%= (google && google.secretSet) ? '•••••••• (ingesteld)': 'GOCSPX-…' %>" autocomplete="off">50 <span><%= t('agoog.client_secret') %> <% if (google && google.secretSet) { %><small style="font-weight:400">— <%= t('agoog.client_secret_set') %></small><% } %></span> 51 <input type="password" name="google_client_secret" placeholder="<%= (google && google.secretSet) ? t('agoog.secret_ph_set') : 'GOCSPX-…' %>" autocomplete="off"> 52 52 </label> 53 53 <div class="set-actions"> 54 <button type="submit" class="btn btn-primary"> Opslaan</button>54 <button type="submit" class="btn btn-primary"><%= t('agoog.save') %></button> 55 55 <% if (google && (google.clientId || google.secretSet)) { %> 56 <button type="submit" name="clear" value="1" class="btn"> Loskoppelen</button>56 <button type="submit" name="clear" value="1" class="btn"><%= t('agoog.disconnect') %></button> 57 57 <% } %> 58 58 </div> 59 59 </form> 60 60 <% if (typeof premiumEnabled !== 'undefined' && premiumEnabled && !isPremium) { %> 61 <p class="set-help" style="margin-top:.7rem; color:var(--accent)"> Premium-laag staat aan zonder Patreon — de Google-knop blijft verborgen tot premium ontgrendeld is.</p>61 <p class="set-help" style="margin-top:.7rem; color:var(--accent)"><%= t('agoog.premium_locked') %></p> 62 62 <% } %> 63 63 </section>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)