1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-08 15:06:08 +02:00

Merge pull request #2706 from wiggin77/GH-2434_pserver_no_error_page

GH-2534: Don't show error page for Personal Server when not logged in
This commit is contained in:
Scott Bishel 2022-04-01 16:22:01 -06:00 committed by GitHub
commit 3f6affbd83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -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**')

View File

@ -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 (
<div className='ErrorPage'>
<div>