Merge branch 'fix/guest-home'
This commit is contained in:
commit
102e5db507
2 changed files with 15 additions and 0 deletions
|
|
@ -76,6 +76,18 @@ describe('session authentication', () => {
|
||||||
cy.location('pathname').should('equal', '/dashboard')
|
cy.location('pathname').should('equal', '/dashboard')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('redirects a restored session away from the home route', () => {
|
||||||
|
cy.intercept('GET', '**/api/me', {
|
||||||
|
statusCode: 200,
|
||||||
|
body: { user: authenticatedUser },
|
||||||
|
}).as('me')
|
||||||
|
|
||||||
|
cy.visit('/')
|
||||||
|
cy.wait('@me')
|
||||||
|
|
||||||
|
cy.location('pathname').should('equal', '/dashboard')
|
||||||
|
})
|
||||||
|
|
||||||
it('rejects a malformed authenticated-user response', () => {
|
it('rejects a malformed authenticated-user response', () => {
|
||||||
cy.intercept('GET', '**/api/me', {
|
cy.intercept('GET', '**/api/me', {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ const router = createRouter({
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'home',
|
name: 'home',
|
||||||
component: () => import('@/views/HomeView.vue'),
|
component: () => import('@/views/HomeView.vue'),
|
||||||
|
meta: {
|
||||||
|
guestOnly: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue