fix(guest): move guest token from URL query to sessionStorage (#21) #28
|
|
@ -158,8 +158,9 @@ describe('GuestCheckoutPage', () => {
|
||||||
await vi.waitFor(() => {
|
await vi.waitFor(() => {
|
||||||
expect(router.currentRoute.value.name).toBe('guest-payment')
|
expect(router.currentRoute.value.name).toBe('guest-payment')
|
||||||
expect(router.currentRoute.value.params.orderId).toBe('order-123')
|
expect(router.currentRoute.value.params.orderId).toBe('order-123')
|
||||||
expect(router.currentRoute.value.query.token).toBe('token-abc')
|
expect(router.currentRoute.value.query.token).toBeUndefined()
|
||||||
expect(router.currentRoute.value.query.plate).toBe('ABC123')
|
expect(router.currentRoute.value.query.plate).toBe('ABC123')
|
||||||
|
expect(sessionStorage.getItem('guestToken')).toBe('token-abc')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,20 @@ async function mountPage(
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
token = 'token-abc',
|
token = 'token-abc',
|
||||||
plate = 'ABC123',
|
plate = 'ABC123',
|
||||||
) {
|
) {
|
||||||
|
// Store token in sessionStorage as GuestCheckoutPage and GuestOrderPage do
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
|
if (token) {
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
|
sessionStorage.setItem('guestToken', token)
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
|
} else {
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
|
sessionStorage.removeItem('guestToken')
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
|
}
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
|
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
const pinia = createPinia()
|
const pinia = createPinia()
|
||||||
setActivePinia(pinia)
|
setActivePinia(pinia)
|
||||||
const router = createTestRouter()
|
const router = createTestRouter()
|
||||||
await router.push({
|
await router.push({
|
||||||
name: 'guest-payment',
|
name: 'guest-payment',
|
||||||
params: { orderId },
|
params: { orderId },
|
||||||
query: { token, plate },
|
query: { plate },
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
})
|
})
|
||||||
await router.isReady()
|
await router.isReady()
|
||||||
|
|
||||||
|
|
@ -99,6 +106,7 @@ function setupDefaultMocks() {
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
describe('GuestPaymentRedirect', () => {
|
describe('GuestPaymentRedirect', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks()
|
vi.clearAllMocks()
|
||||||
|
sessionStorage.clear()
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
setupDefaultMocks()
|
setupDefaultMocks()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
hermes
commented
💡 Suggestion: The backward-compat fallback ( 💡 **Suggestion**: The backward-compat fallback (`sessionStorage.getItem('guestToken') || route.query.token`) is untested. Consider adding a test case where `mountPage` is called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.
|
|||||||
|
|
@ -37,11 +37,14 @@ async function handleSubmit() {
|
||||||
letterText.value,
|
letterText.value,
|
||||||
email.value.trim(),
|
email.value.trim(),
|
||||||
)
|
)
|
||||||
// Token rides in the query string so the payment page survives refresh.
|
// Store the guest token in sessionStorage so it does not leak via the URL
|
||||||
|
// query string (browser history, access logs, Referer). sessionStorage
|
||||||
|
// persists across page refreshes within the same tab.
|
||||||
|
sessionStorage.setItem('guestToken', order.guestToken)
|
||||||
await router.push({
|
await router.push({
|
||||||
name: 'guest-payment',
|
name: 'guest-payment',
|
||||||
params: { orderId: order.id },
|
params: { orderId: order.id },
|
||||||
query: { token: order.guestToken, plate: order.plate },
|
query: { plate: order.plate },
|
||||||
})
|
})
|
||||||
} catch {
|
} catch {
|
||||||
errorMessage.value = 'Kunde inte skapa beställningen. Försök igen senare.'
|
errorMessage.value = 'Kunde inte skapa beställningen. Försök igen senare.'
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
import { fetchGuestOrder, type GuestOrder } from '@/api/guestOrders'
|
import { fetchGuestOrder, type GuestOrder } from '@/api/guestOrders'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
const token = route.params.token as string
|
const token = route.params.token as string
|
||||||
|
|
||||||
const order = ref<GuestOrder | null>(null)
|
const order = ref<GuestOrder | null>(null)
|
||||||
|
|
@ -45,6 +46,18 @@ onMounted(async () => {
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
function goToPayment() {
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
if (!order.value) return
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
// Store the guest token in sessionStorage so it does not leak via the URL
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
// query string on the payment page.
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
sessionStorage.setItem('guestToken', token)
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
router.push({
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
name: 'guest-payment',
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
params: { orderId: order.value.id },
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
query: { plate: order.value.plate },
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
})
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
}
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -78,15 +91,7 @@ onMounted(async () => {
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p v-if="order.status === 'pending_payment'" class="guest-order__hint">
|
<p v-if="order.status === 'pending_payment'" class="guest-order__hint">
|
||||||
<RouterLink
|
<a href="#" @click.prevent="goToPayment"> Gå till betalningssidan </a>
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
:to="{
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
name: 'guest-payment',
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
params: { orderId: order.id },
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
query: { token, plate: order.plate },
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
}"
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
>
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
Gå till betalningssidan
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
</RouterLink>
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="guest-order__letter">
|
<div class="guest-order__letter">
|
||||||
|
|
|
||||||
|
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
hermes
commented
💡 Suggestion: 💡 **Suggestion**: `<a href="#" @click.prevent>` degrades screen-reader semantics (a link to `#` / nowhere). A `<button>` styled to match, or keeping `<RouterLink>` with a custom navigation guard, would preserve accessibility without changing the visual result.
|
|||||||
|
|
@ -9,7 +9,11 @@ const router = useRouter()
|
||||||
|
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const orderId = route.params.orderId as string
|
const orderId = route.params.orderId as string
|
||||||
const token = (route.query.token as string) || ''
|
// Read token from sessionStorage (set by the checkout/order pages) so it
|
||||||
|
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
|
|||||||
|
// does not leak via the URL query string. Fall back to query.token for
|
||||||
|
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
|
|||||||
|
// backward compatibility with any existing magic links.
|
||||||
|
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
|
|||||||
|
const token =
|
||||||
|
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
|
|||||||
|
sessionStorage.getItem('guestToken') || (route.query.token as string) || ''
|
||||||
|
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
|
|||||||
|
|
||||||
const plate = ref((route.query.plate as string) || '')
|
const plate = ref((route.query.plate as string) || '')
|
||||||
const swishNumber = ref('')
|
const swishNumber = ref('')
|
||||||
|
|
|
||||||
|
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
hermes
commented
💡 Suggestion: Consider 💡 **Suggestion**: Consider `sessionStorage.removeItem('guestToken')` right after `payGuestOrder(token)` resolves, before the `router.push`. The token has been consumed at this point and lingering in sessionStorage only extends the credential's lifetime unnecessarily.
|
|||||||
💡 Suggestion: The backward-compat fallback (
sessionStorage.getItem('guestToken') || route.query.token) is untested. Consider adding a test case wheremountPageis called with the token in the route query but sessionStorage cleared, to verify the fallback works for old bookmarked URLs.