Highlight SSO in register/login/home pages (#6396)

* Highlight SSO in register and login pages
* Highlight SSO in home page
* updated split test request to new APIs
* reordered SSO buttons when highlighting SSO in login
* Updated copy for institutional login and fixed indentation
* increased SSO button size in homepage for highlight-sso variant
* prefill email in registration page
* added `register` and `register-success` events

GitOrigin-RevId: 2822afc15c27856ca713002ed804e1f42a2d955c
This commit is contained in:
Miguel Serrano 2022-02-02 14:50:19 +01:00 committed by Copybot
parent 30cd3d2961
commit 0f7948cfdf
4 changed files with 36 additions and 2 deletions

View file

@ -21,6 +21,9 @@ const fs = require('fs')
const ErrorController = require('../Errors/ErrorController')
const SessionManager = require('../Authentication/SessionManager')
const SplitTestHandler = require('../SplitTests/SplitTestHandler')
const logger = require('@overleaf/logger')
const homepageExists = fs.existsSync(
Path.join(__dirname, '/../../../views/external/home/v2.pug')
)
@ -38,9 +41,20 @@ module.exports = HomeController = {
}
},
home(req, res, next) {
async home(req, res) {
if (Features.hasFeature('homepage') && homepageExists) {
return res.render('external/home/v2')
try {
const highlightSSOAssignment =
await SplitTestHandler.promises.getAssignment(req, 'highlight-sso')
const highlightSSO = highlightSSOAssignment.variant === 'active'
return res.render('external/home/v2', { highlightSSO })
} catch (err) {
logger.error(
{ err },
"error fetching 'highlight-sso' split test assignment"
)
return res.render('external/home/v2', { highlightSSO: false })
}
} else {
return res.redirect('/login')
}

View file

@ -195,6 +195,21 @@
}
}
.hp-login-btn-large {
.hp-login-btn;
min-width: 256px;
padding-left: 30px;
font-size: 20px;
}
.hp-login-btn-icon-large {
.login-btn-icon;
width: 32px;
height: 32px;
}
.hp-register-form-email-pwd {
position: relative;
}

View file

@ -155,3 +155,7 @@
.registration-message-details {
font-size: 90%;
}
.registration-block-separator {
margin-bottom: 0px;
}

View file

@ -174,6 +174,7 @@
"need_to_do_this_to_access_license": "Youll need to do this in order to have access to the benefits from the <b>__institutionName__</b> site license.",
"institutional_login_not_supported": "Your university doesnt support <b>institutional login</b> yet, but you can still register with your institutional email.",
"institutional_login_unknown": "Sorry, we dont know which institution issued that email address. You can browse our <a href=\"__link__\">list of institutions</a> to find yours, or you can just register using your email address and password here.",
"institutional_login_unknown_sso_highlight_variant": "Sorry, we dont know which institution issued that email address. You can browse our <a href=\"__link__\">list of institutions</a> to find yours, or you can use one of the other options below.",
"link_account": "Link Account",
"link_accounts": "Link Accounts",
"link_accounts_and_add_email": "Link Accounts and Add Email",