mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-16 17:11:58 +00:00
Merge pull request #17912 from overleaf/jel-sso-enroll-after-login
[web] Redirect to group SSO enrollment page after log in GitOrigin-RevId: 4c0937de6f009cd6e7e094569eb9ad46606a763b
This commit is contained in:
parent
7e3dfded2d
commit
a815ba6e5c
1 changed files with 6 additions and 2 deletions
|
@ -299,7 +299,7 @@ class UserHelper {
|
|||
* @param {string} userData.password
|
||||
* @returns {UserHelper}
|
||||
*/
|
||||
static async loginUser(userData) {
|
||||
static async loginUser(userData, expectedRedirect) {
|
||||
if (!userData || !userData.email || !userData.password) {
|
||||
throw new Error('email and password required')
|
||||
}
|
||||
|
@ -327,7 +327,11 @@ class UserHelper {
|
|||
}
|
||||
|
||||
const body = await response.json()
|
||||
if (body.redir !== '/project') {
|
||||
if (
|
||||
body.redir !== '/project' &&
|
||||
expectedRedirect &&
|
||||
body.redir !== expectedRedirect
|
||||
) {
|
||||
const error = new Error(
|
||||
`login should redirect to /project: status=${
|
||||
response.status
|
||||
|
|
Loading…
Reference in a new issue