From 70e97227a48c3135c5ae027107783ca253dd7752 Mon Sep 17 00:00:00 2001 From: wiggin77 Date: Fri, 1 Apr 2022 12:19:16 -0400 Subject: [PATCH 1/2] don't show error page when not plugin for not-logged-in --- webapp/src/pages/errorPage.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/src/pages/errorPage.tsx b/webapp/src/pages/errorPage.tsx index 2a2063fc6..6fec8e86b 100644 --- a/webapp/src/pages/errorPage.tsx +++ b/webapp/src/pages/errorPage.tsx @@ -10,6 +10,7 @@ import Button from '../widgets/buttons/button' import './errorPage.scss' import {errorDefFromId, ErrorId} from '../errors' +import {Utils} from '../utils' const ErrorPage = () => { const history = useHistory() @@ -45,6 +46,10 @@ const ErrorPage = () => { ) }) + if (!Utils.isFocalboardPlugin() && errid === ErrorId.NotLoggedIn) { + handleButtonClick(errorDef.button1Redirect) + } + return (
From 19ed0d73fe45cad1bbda6577e9f6b3b1b93178ff Mon Sep 17 00:00:00 2001 From: wiggin77 Date: Fri, 1 Apr 2022 13:43:49 -0400 Subject: [PATCH 2/2] fix cypress tests --- webapp/cypress/integration/loginActions.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/webapp/cypress/integration/loginActions.ts b/webapp/cypress/integration/loginActions.ts index 34c05578c..7d5c463ca 100644 --- a/webapp/cypress/integration/loginActions.ts +++ b/webapp/cypress/integration/loginActions.ts @@ -8,10 +8,8 @@ describe('Login actions', () => { it('Can perform login/register actions', () => { // Redirects to login page - cy.log('**Redirects to error then login page**') + cy.log('**Redirects to login page (except plugin mode) **') cy.visit('/') - cy.location('pathname').should('eq', '/error') - cy.get('button').contains('Log in').click() cy.location('pathname').should('eq', '/login') cy.get('.LoginPage').contains('Log in') cy.get('#login-username').should('exist') @@ -40,7 +38,7 @@ describe('Login actions', () => { // User should not be logged in automatically cy.log('**User should not be logged in automatically**') cy.visit('/') - cy.location('pathname').should('eq', '/error') + cy.location('pathname').should('eq', '/login') // Can log in registered user cy.log('**Can log in registered user**')