-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cad0203
commit ab7ba5f
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<DefaultLayout> | ||
<div class="h-screen auth-page py-12">{{ $t('auth.content') }}</div> | ||
</DefaultLayout> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { navigate } from 'vike/client/router'; | ||
import { inject, onBeforeMount } from 'vue' | ||
import DefaultLayout from '#layouts/DefaultLayout.vue' | ||
import AuthService from '#src/services/AuthService' | ||
const authService = inject<AuthService>('authService') | ||
onBeforeMount(async () => { | ||
try { | ||
await authService?.renewToken() | ||
navigate('/') | ||
} catch (error) { | ||
// eslint-disable-next-line no-console | ||
console.log('auth error', error) | ||
} | ||
}) | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.auth-page { | ||
display: flex; | ||
justify-content: center; | ||
p { | ||
display: flex; | ||
font-size: 1.5em; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 120%; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const title = 'DreamMall | Authentifizierung' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { mount } from '@vue/test-utils' | ||
import { describe, it, expect } from 'vitest' | ||
import { Component, h } from 'vue' | ||
import { VApp } from 'vuetify/components' | ||
|
||
import SilentRefreshPage from './+Page.vue' | ||
import { title } from './+title' | ||
|
||
describe('SilentRefreshPage', () => { | ||
const wrapper = mount(VApp, { | ||
slots: { | ||
default: h(SilentRefreshPage as Component), | ||
}, | ||
}) | ||
|
||
it('title returns correct title', () => { | ||
expect(title).toBe('DreamMall | Authentifizierung') | ||
}) | ||
|
||
it('renders', () => { | ||
expect(wrapper.element).toMatchSnapshot() | ||
Check failure on line 21 in presenter/src/pages/silent-refresh/Page.test.ts GitHub Actions / Unit - Presentersrc/pages/silent-refresh/Page.test.ts > SilentRefreshPage > renders
|
||
}) | ||
}) |