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:
@@ -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) {
|
||||
|
||||
@@ -92,6 +92,7 @@ const nextConfig = {
|
||||
|
||||
output: "standalone",
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
webpack: function (config: any) {
|
||||
config.module.rules.push(
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "yarn clean && next build",
|
||||
"build": "next build",
|
||||
"dev": "NODE_OPTIONS=--openssl-legacy-provider PORT=3000 NEXT_PUBLIC_PORT=3000 next dev",
|
||||
"lint": "yarn clean && next lint --max-warnings 0 && tsc",
|
||||
"lint:fix": "yarn clean && next lint --fix --max-warnings 0 && tsc",
|
||||
@@ -78,7 +78,7 @@
|
||||
"motion": "^12.10.0",
|
||||
"nanoid": "^5.1.5",
|
||||
"next": "15.3.4",
|
||||
"next-auth": "5.0.0-beta.27",
|
||||
"next-auth": "5.0.0-beta.29",
|
||||
"react": "19.1.0",
|
||||
"react-aria-components": "^1.8.0",
|
||||
"react-day-picker": "^9.6.7",
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"extends": ["//"],
|
||||
"tasks": {
|
||||
"lint": { "dependsOn": [] },
|
||||
"build": { "dependsOn": ["include:shared"] },
|
||||
"dev": { "dependsOn": ["include:shared"] },
|
||||
"build": { "dependsOn": ["clean", "include:shared"] },
|
||||
"dev": { "dependsOn": ["clean", "include:shared"] },
|
||||
"test": {
|
||||
"dependsOn": [
|
||||
"@scandic-hotels/trpc#test",
|
||||
@@ -13,6 +14,9 @@
|
||||
},
|
||||
"include:shared": {
|
||||
"outputs": ["public/_static/shared/**"]
|
||||
},
|
||||
"clean": {
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ function redeemLocationIsOnSite(
|
||||
return location === "On-site"
|
||||
}
|
||||
|
||||
function isTierType(type: string): type is "Tier" {
|
||||
export function isTierType(type: string): type is "Tier" {
|
||||
return type === "Tier"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user