Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow Google guidelines to use Google OAuth #1588

Merged
merged 3 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ app.set('view engine', 'ejs')
app.locals.useCDN = config.useCDN
app.locals.serverURL = config.serverURL
app.locals.sourceURL = config.sourceURL
app.locals.privacyPolicyURL = config.privacyPolicyURL
app.locals.allowAnonymous = config.allowAnonymous
app.locals.allowAnonymousEdits = config.allowAnonymousEdits
app.locals.permission = config.permission
Expand Down
1 change: 1 addition & 0 deletions lib/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = {
defaultPermission: 'editable',
dbURL: '',
db: {},
privacyPolicyURL: '',
// ssl path
sslKeyPath: '',
sslCertPath: '',
Expand Down
1 change: 1 addition & 0 deletions lib/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
sessionSecret: process.env.CMD_SESSION_SECRET,
sessionLife: toIntegerConfig(process.env.CMD_SESSION_LIFE),
responseMaxLag: toIntegerConfig(process.env.CMD_RESPONSE_MAX_LAG),
privacyPolicyURL: process.env.CMD_PRIVACY_POLICY_URL,
imageUploadType: process.env.CMD_IMAGE_UPLOAD_TYPE,
imgur: {
clientID: process.env.CMD_IMGUR_CLIENTID
Expand Down
1 change: 1 addition & 0 deletions public/views/index/body.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<h6 class="social-foot">
<%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/CodiMD" target="_blank" rel="noopener"><i class="fa fa-github"></i> GitHub</a>, <a href="https://gitter.im/hackmdio/hackmd" target="_blank" rel="noopener"><i class="fa fa-comments"></i> Gitter</a>', '<a href="https://poeditor.com/join/project/q0nuPWyztp" target="_blank" rel="noopener"><i class="fa fa-globe"></i> POEditor</a>') %>
</h6>
<% if(privacyPolicyURL && privacyPolicyURL.length > 0) { %><p><a href="<%- privacyPolicyURL %>"><%= __('Privacy Policy') %></a></p><% } %>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/views/shared/signin-modal.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
</a>
<% } %>
<% if (authProviders.google) { %>
<a href="<%- serverURL %>/auth/google" class="btn btn-lg btn-block btn-login-method btn-google">
<i class="fa fa-google"></i> <%= __('Sign in via %s', 'Google') %>
<a href="<%- serverURL %>/auth/google" class="btn btn-lg btn-block" style="color: #fff; background-color: #4285F4; vertical-align: middle; font-size: 14px; font-family: Roboto;">
<svg aria-hidden="true" width="34" height="34" viewBox="-8 -8 34 34" style="vertical-align: middle; margin-right: 16; background-color=#fff;"><path d="M16.51 8H8.98v3h4.3c-.18 1-.74 1.48-1.6 2.04v2.01h2.6a7.8 7.8 0 002.38-5.88c0-.57-.05-.66-.15-1.18z" fill="#4285F4"></path><path d="M8.98 17c2.16 0 3.97-.72 5.3-1.94l-2.6-2a4.8 4.8 0 01-7.18-2.54H1.83v2.07A8 8 0 008.98 17z" fill="#34A853"></path><path d="M4.5 10.52a4.8 4.8 0 010-3.04V5.41H1.83a8 8 0 000 7.18l2.67-2.07z" fill="#FBBC05"></path><path d="M8.98 4.18c1.17 0 2.23.4 3.06 1.2l2.3-2.3A8 8 0 001.83 5.4L4.5 7.49a4.77 4.77 0 014.48-3.3z" fill="#EA4335"></path></svg> <%= __('Sign in via %s', 'Google') %>
</a>
<% } %>
<% if (authProviders.saml) { %>
Expand Down