diff --git a/bun.lockb b/bun.lockb index c94105c..1069226 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/loading.vue b/components/loading.vue index f666075..d2d1f39 100644 --- a/components/loading.vue +++ b/components/loading.vue @@ -10,15 +10,7 @@ \ No newline at end of file diff --git a/components/settings/oidc.vue b/components/settings/oidc.vue index 67a8f4f..a81131c 100644 --- a/components/settings/oidc.vue +++ b/components/settings/oidc.vue @@ -51,7 +51,7 @@ const link = async (providerId: string) => { useEvent("notification:new", { title: "Failed to link account", - message: e.response.data.error, + description: e.response.data.error, type: "error", }); } @@ -78,7 +78,7 @@ const unlink = async (providerId: string) => { useEvent("notification:new", { title: "Failed to unlink account", - message: e.response.data.error, + description: e.response.data.error, type: "error", }); } diff --git a/components/settings/profile-editor.vue b/components/settings/profile-editor.vue index bd8b6d6..0de82a4 100644 --- a/components/settings/profile-editor.vue +++ b/components/settings/profile-editor.vue @@ -112,7 +112,7 @@ const save = async () => { useEvent("notification:new", { title: "Failed to update profile", - message: error.response.data.error, + description: error.response.data.error, type: "error", }); } diff --git a/components/sidebars/navigation.vue b/components/sidebars/navigation.vue index 79b6df9..e9f58eb 100644 --- a/components/sidebars/navigation.vue +++ b/components/sidebars/navigation.vue @@ -222,7 +222,7 @@ const signOut = async (id?: string) => { await useEvent("notification:new", { type: "success", title: "Signed out", - message: "Account signed out successfully", + description: "Account signed out successfully", }); }; \ No newline at end of file diff --git a/composables/CacheRefresh.ts b/composables/CacheRefresh.ts index 0fa89de..2f3dcb5 100644 --- a/composables/CacheRefresh.ts +++ b/composables/CacheRefresh.ts @@ -29,7 +29,7 @@ export const useCacheRefresh = (client: MaybeRef) => { useEvent("notification:new", { type: "error", title: "Your session has expired", - message: + description: "You have been logged out. Please log in again.", }); } diff --git a/composables/Client.ts b/composables/Client.ts index 92b3f21..d1a68d4 100644 --- a/composables/Client.ts +++ b/composables/Client.ts @@ -17,7 +17,7 @@ export const useClient = ( useEvent("notification:new", { title: "An error occured", type: "error", - message: + description: error.response.data.error ?? "No error message provided", }); diff --git a/composables/EventBus.ts b/composables/EventBus.ts index 65d07fa..0928750 100644 --- a/composables/EventBus.ts +++ b/composables/EventBus.ts @@ -1,14 +1,11 @@ +import type { createToaster } from "@ark-ui/vue"; import type { Attachment, Status } from "@lysand-org/client/types"; import mitt from "mitt"; import type { Identity } from "./Identities"; -export type NotificationEvent = { - type: "error" | "success" | "progress"; - title: string; - message?: string; - persistent?: boolean; - onDismiss?: () => void; -}; +export type NotificationEvent = Parameters< + ReturnType["create"] +>[0]; type ApplicationEvents = { "note:reply": Status; diff --git a/package.json b/package.json index f03354d..402be3b 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "dependencies": { "@ark-ui/vue": "^3.4.0", - "@lysand-org/client": "^0.2.0", + "@lysand-org/client": "^0.2.1", "@nuxt/fonts": "^0.7.0", "@tailwindcss/typography": "^0.5.13", "@vee-validate/nuxt": "^4.13.1", diff --git a/pages/oauth/authorize.vue b/pages/oauth/authorize.vue index e24edde..abfc59f 100644 --- a/pages/oauth/authorize.vue +++ b/pages/oauth/authorize.vue @@ -4,12 +4,12 @@ class="mx-auto hidden md:inline-block h-20 ring-1 ring-white/20 rounded" />
+ :action="`/api/auth/login?redirect_uri=${params.redirect_uri}&response_type=${params.response_type}&client_id=${params.client_id}&scope=${params.scope}`">

Login to your account

-
+

An error occured

- {{ error_description }} + {{ params.error_description }}
@@ -41,7 +41,7 @@
+ :href="`/oauth/sso?issuer=${provider.id}&redirect_uri=${params.redirect_uri}&response_type=${params.response_type}&client_id=${params.client_id}&scope=${params.scope}`"> @@ -108,17 +108,13 @@ const schema = toTypedSchema( ); const hostname = useRequestURL().hostname; -const query = new URLSearchParams( - window?.location.search ?? useRequestURL().search, -); -const redirectUri = query.get("redirect_uri"); -const responseType = query.get("response_type"); -const clientId = query.get("client_id"); -const scope = query.get("scope"); -const error = query.get("error"); -const errorDescription = query.get("error_description"); +const params = useUrlSearchParams(); -const validUrlParameters = redirectUri && responseType && clientId && scope; +const validUrlParameters = + params.redirect_uri && + params.response_type && + params.client_id && + params.scope; const ssoConfig = useSSOConfig(); \ No newline at end of file diff --git a/pages/oauth/code.vue b/pages/oauth/code.vue index af915fd..59b8bb9 100644 --- a/pages/oauth/code.vue +++ b/pages/oauth/code.vue @@ -23,9 +23,7 @@ diff --git a/pages/oauth/consent.vue b/pages/oauth/consent.vue index 3f96b5b..6369eb7 100644 --- a/pages/oauth/consent.vue +++ b/pages/oauth/consent.vue @@ -83,18 +83,16 @@ \ No newline at end of file