@fy-/fws-vue 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,9 +120,6 @@ const userFlow = async (params: paramsType = { initial: false }) => {
120
120
  },
121
121
  )) as UserFlow;
122
122
  if (response.value?.result == "success") {
123
- if (props.onSuccess) {
124
- await props.onSuccess();
125
- }
126
123
  if (response.value.data.complete == true && response.value.data.user) {
127
124
  store.setUser(response.value.data.user);
128
125
  const actualReturnTo = response.value.data.redirect
@@ -130,11 +127,19 @@ const userFlow = async (params: paramsType = { initial: false }) => {
130
127
  : returnTo.value;
131
128
  session.value = null;
132
129
  if (isExternalUrl(actualReturnTo)) {
133
- window.location.href = actualReturnTo;
130
+ if (props.onSuccess) {
131
+ await props.onSuccess();
132
+ } else {
133
+ window.location.href = actualReturnTo;
134
+ }
134
135
  } else {
135
- const routeExists = router.resolve(actualReturnTo);
136
- if (routeExists.matched.length != 0) router.push(actualReturnTo);
137
- else window.location.href = actualReturnTo;
136
+ if (props.onSuccess) {
137
+ await props.onSuccess();
138
+ } else {
139
+ const routeExists = router.resolve(actualReturnTo);
140
+ if (routeExists.matched.length != 0) router.push(actualReturnTo);
141
+ else window.location.href = actualReturnTo;
142
+ }
138
143
  }
139
144
  return;
140
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {