Skip to content

Commit

Permalink
klb user flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Fy- committed Apr 28, 2024
1 parent 21f5b66 commit 35d669f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/klb-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fy-/klb-vue",
"version": "0.0.099",
"version": "0.0.104",
"author": "Florian 'Fy' Gasquez <m@fy.to>",
"license": "MIT",
"repository": {
Expand Down
12 changes: 6 additions & 6 deletions packages/klb-vue/src/components/klb/UserFlow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ const userFlow = async (params: paramsType = { initial: false }) => {
)) as UserFlow;
if (response.value?.result == "success") {
if (response.value.data.complete == true && response.value.data.user) {
if (response.value.data.Redirect && response.value.data.complete) {
response.value.data.Redirect
? (window.location.href = response.value.data.Redirect)
: router.push("/");
return;
}
store.setUser(response.value.data.user);
if (props.onSuccess) {
await props.onSuccess();
Expand All @@ -158,12 +164,6 @@ const userFlow = async (params: paramsType = { initial: false }) => {
window.location.href = response.value.data.url;
return;
}
if (response.value.data.Redirect && response.value.data.complete) {
response.value.data.Redirect
? router.push(response.value.data.Redirect)
: router.push("/");
return;
}
formData.value = {
session: response.value.data.session,
};
Expand Down
4 changes: 2 additions & 2 deletions packages/klb-vue/src/components/ui/DefaultBreadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import type { BreadcrumbLink } from "../../types/types";
withDefaults(
defineProps<{
nav: BreadcrumbLink[];
showHome: Boolean;
showHome?: Boolean;
}>(),
{
nav: () => [],
showHome: () => true,
showHome: () => false,
},
);
</script>
Expand Down

0 comments on commit 35d669f

Please sign in to comment.