-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into launcher-db-overhual
- Loading branch information
Showing
25 changed files
with
312 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function useTheme() { | ||
return useNuxtApp().$theme; | ||
} | ||
|
||
export function useCosmetics() { | ||
return useNuxtApp().$cosmetics; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Creates a computed reference that uses a provide getter function called with an argument representing the current mount state of the component. | ||
* @param getter A getter function that will run with `mounted` argument representing whether or not the component is mounted. | ||
* @returns A computed reference that changes when component becomes mounted or unmounted. | ||
*/ | ||
export function useMountedValue<T>(getter: (isMounted: boolean) => T) { | ||
const mounted = ref(getCurrentInstance()?.isMounted ?? false); | ||
|
||
onMounted(() => (mounted.value = true)); | ||
|
||
onUnmounted(() => (mounted.value = false)); | ||
|
||
return computed(() => getter(mounted.value)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const whitelistedParams = ["flow", "error"]; | ||
|
||
export default defineNuxtRouteMiddleware(async (_to, from) => { | ||
const config = useRuntimeConfig(); | ||
const auth = await useAuth(); | ||
|
||
if (auth.value.user) return; | ||
|
||
const fullPath = from.fullPath; | ||
|
||
const url = new URL(fullPath, config.public.apiBaseUrl); | ||
|
||
const extractedParams = Object.create(null) as Record<string, string>; | ||
|
||
for (const param of whitelistedParams) { | ||
const val = url.searchParams.get(param); | ||
if (val != null) { | ||
extractedParams[param] = val; | ||
url.searchParams.delete(param); | ||
} | ||
} | ||
|
||
const redirect = encodeURIComponent(url.pathname + url.search); | ||
|
||
return await navigateTo( | ||
{ | ||
path: "/auth/sign-in", | ||
query: { | ||
redirect, | ||
...extractedParams, | ||
}, | ||
}, | ||
{ replace: true }, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.