1
0

Add TailwindCSS (#1252)

* Setup TailwindCSS

* Fully setup configuration

* Refactor some tailwind variables
This commit is contained in:
Evan Song
2024-07-06 20:57:32 -07:00
committed by GitHub
parent 0f2ddb452c
commit abec2e48d4
176 changed files with 7905 additions and 7433 deletions

View File

@@ -1,27 +1,28 @@
const whitelistedParams = ['flow', 'error']
/* eslint-disable no-undef */
const whitelistedParams = ["flow", "error"];
export default defineNuxtRouteMiddleware(async (_to, from) => {
const config = useRuntimeConfig()
const auth = await useAuth()
const config = useRuntimeConfig();
const auth = await useAuth();
if (!auth.value.user) {
const fullPath = from.fullPath
const fullPath = from.fullPath;
const url = new URL(fullPath, config.public.apiBaseUrl)
const url = new URL(fullPath, config.public.apiBaseUrl);
const extractedParams = whitelistedParams.reduce((acc, param) => {
if (url.searchParams.has(param)) {
acc[param] = url.searchParams.get(param)
url.searchParams.delete(param)
acc[param] = url.searchParams.get(param);
url.searchParams.delete(param);
}
return acc
}, {})
return acc;
}, {});
const redirectPath = encodeURIComponent(url.pathname + url.search)
const redirectPath = encodeURIComponent(url.pathname + url.search);
return await navigateTo(
{
path: '/auth/sign-in',
path: "/auth/sign-in",
query: {
redirect: redirectPath,
...extractedParams,
@@ -29,7 +30,7 @@ export default defineNuxtRouteMiddleware(async (_to, from) => {
},
{
replace: true,
}
)
},
);
}
})
});