Merged in feat/SW-2903-tokens (pull request #2508)
feat(SW-2358): Use personal token if logged in * feat(SW-2903): Use personal token if logged in * Avoid encoding values in cookie * Fix tests Approved-by: Anton Gunnarsson
This commit is contained in:
committed by
Anton Gunnarsson
parent
5d9006bfdc
commit
b35ceafc00
@@ -18,6 +18,13 @@ import {
|
||||
|
||||
import styles from "./findMyBooking.module.css"
|
||||
|
||||
export type AdditionalInfoCookieValue = {
|
||||
firstName: string
|
||||
email: string
|
||||
confirmationNumber: string
|
||||
lastName: string
|
||||
}
|
||||
|
||||
export default function AdditionalInfoForm({
|
||||
confirmationNumber,
|
||||
lastName,
|
||||
@@ -36,12 +43,12 @@ export default function AdditionalInfoForm({
|
||||
|
||||
function onSubmit() {
|
||||
const values = form.getValues()
|
||||
const value = new URLSearchParams({
|
||||
const value: AdditionalInfoCookieValue = {
|
||||
...values,
|
||||
confirmationNumber,
|
||||
lastName,
|
||||
}).toString()
|
||||
document.cookie = `bv=${encodeURIComponent(value)}; Path=/; Max-Age=600; Secure; SameSite=Strict`
|
||||
}
|
||||
document.cookie = `bv=${JSON.stringify(value)}; Path=/; Max-Age=600; Secure; SameSite=Strict`
|
||||
router.refresh()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user