Merged in feat/SW-3461-setup-auth-with-sas-eurobonus (pull request #2825)

Feat/SW-3461 setup auth with sas eurobonus

* feat(SW-3461): Setup auth for sas eurobonus

* .

* feat: setup auth towards SAS

* Fix auth via SAS and add logout route

* .

* merge

* auth via SAS

* fix powered by scandic logo

* Merge branch 'master' of bitbucket.org:scandic-swap/web into feat/SW-3461-setup-auth-with-sas-eurobonus

* Include access_token in jwt after successful login

* merge


Approved-by: Anton Gunnarsson
This commit is contained in:
Joakim Jäderberg
2025-09-22 09:30:36 +00:00
parent 9b8ed972ec
commit 8ebc48b138
24 changed files with 494 additions and 76 deletions

View File

@@ -23,12 +23,12 @@ export const middleware: NextMiddleware = async (request) => {
? pathWithoutTrailingSlash.replace("/preview", "")
: pathWithoutTrailingSlash
let { contentType, uid, error } =
await getUidAndContentTypeByPath(incomingPathName)
if (error) {
throw internalServerError(error)
const uidAndContent = await getUidAndContentTypeByPath(incomingPathName)
if (uidAndContent.error) {
throw internalServerError(uidAndContent.error)
}
let { contentType, uid } = uidAndContent
const searchParams = new URLSearchParams(request.nextUrl.searchParams)
if (!contentType || !uid) {
@@ -40,7 +40,7 @@ export const middleware: NextMiddleware = async (request) => {
if (incomingPathNameParts.length >= 2) {
const subpage = incomingPathNameParts.pop()
if (subpage) {
let { contentType: parentContentType, uid: parentUid } =
const { contentType: parentContentType, uid: parentUid } =
await getUidAndContentTypeByPath(incomingPathNameParts.join("/"))
if (parentUid) {