@designcrowd/fe-shared-lib 1.0.8-ml-82-8 → 1.0.8-ml-82-11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.0.8-ml-82-8",
3
+ "version": "1.0.8-ml-82-11",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -57,7 +57,7 @@
57
57
  </p>
58
58
  <div class="tw-flex tw-flex-col">
59
59
  <div>
60
- <form id="signin" action="/identity/account/signin" method="post" @submit="validate">
60
+ <form id="signin" :action="actionUrl" method="post" @submit="validate">
61
61
  <input name="__RequestVerificationToken" type="hidden" :value="antiForgeryToken" />
62
62
  <label for="userName" class="tw-sr-only"> {{ emailLabel }} </label>
63
63
  <input
@@ -139,6 +139,8 @@
139
139
  :disabled="isLoading"
140
140
  :facebook-loading="facebookLoading"
141
141
  :google-loading="googleLoading"
142
+ :login-with-google-label="loginWithGoogleLabel"
143
+ :login-with-facebook-label="loginWithFacebookLabel"
142
144
  />
143
145
  </div>
144
146
  </div>
@@ -328,6 +330,21 @@ export default {
328
330
  required: false,
329
331
  default: undefined,
330
332
  },
333
+ loginWithGoogleLabel: {
334
+ type: String,
335
+ required: false,
336
+ default: undefined,
337
+ },
338
+ loginWithFacebookLabel: {
339
+ type: String,
340
+ required: false,
341
+ default: undefined,
342
+ },
343
+ returnUrl: {
344
+ type: String,
345
+ required: false,
346
+ default: undefined,
347
+ },
331
348
  },
332
349
  data() {
333
350
  return {
@@ -369,6 +386,10 @@ export default {
369
386
  return url;
370
387
  },
371
388
  getRedirectToRecommendedActionUrl() {
389
+ if (typeof window === 'undefined') {
390
+ return null;
391
+ }
392
+
372
393
  const url = new URL(`https://${window.location.host}${this.recommendedActionLink}`);
373
394
  if (this.aUserName) {
374
395
  url.searchParams.append('email', this.aUserName);
@@ -384,6 +405,9 @@ export default {
384
405
  }
385
406
  return this.signUpText;
386
407
  },
408
+ actionUrl() {
409
+ return this.returnUrl ? `/identity/account/signin?returnUrl=${this.returnUrl}` : '/identity/account/signin';
410
+ },
387
411
  },
388
412
  watch: {
389
413
  capturePassword() {
@@ -32,7 +32,7 @@
32
32
  <h2 v-if="title" class="tw-text-center tw-text-4xl tw-font-bold tw-mb-6">
33
33
  {{ title }}
34
34
  </h2>
35
- <form id="signup" action="/identity/account/signup" method="post" @submit="validate">
35
+ <form id="signup" :action="actionUrl" method="post" @submit="validate">
36
36
  <input name="__RequestVerificationToken" type="hidden" :value="antiForgeryToken" />
37
37
  <label for="userName" class="tw-sr-only"> {{ emailLabel }} </label>
38
38
  <input
@@ -225,6 +225,11 @@ export default {
225
225
  required: false,
226
226
  default: undefined,
227
227
  },
228
+ returnUrl: {
229
+ type: String,
230
+ required: false,
231
+ default: undefined,
232
+ },
228
233
  },
229
234
  data() {
230
235
  return {
@@ -248,12 +253,19 @@ export default {
248
253
  return url;
249
254
  },
250
255
  getRedirectToRecommendedActionUrl() {
256
+ if (typeof window === 'undefined') {
257
+ return null;
258
+ }
259
+
251
260
  const url = new URL(`https://${window.location.host}${this.recommendedActionLink}`);
252
261
  if (this.aUserName) {
253
262
  url.searchParams.append('email', this.aUserName);
254
263
  }
255
264
  return url?.toString();
256
265
  },
266
+ actionUrl() {
267
+ return this.returnUrl ? `/identity/account/signup?returnUrl=${this.returnUrl}` : '/identity/account/signup';
268
+ },
257
269
  },
258
270
  methods: {
259
271
  validate(e) {