This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 3 files changed +19
-4
lines changed
3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ workflows:
74
74
branches :
75
75
only :
76
76
- dev
77
- - feat/onboarding-app
77
+ - feat/regsource
78
78
79
79
# Production builds are exectuted only on tagged commits to the
80
80
# master branch.
Original file line number Diff line number Diff line change @@ -48,3 +48,8 @@ export const PLATFORM_DOMAIN =
48
48
process . env . APPENV === "local"
49
49
? window . location . origin
50
50
: config . URL . PLATFORM_DOMAIN ;
51
+
52
+ export const PATH_REG_SOURCE_MAP = [
53
+ { path : "/earn/gigs" , regSource : "gigs" } ,
54
+ { path : "/earn/find/challenges" , regSource : "challenges" } ,
55
+ ] ;
Original file line number Diff line number Diff line change 1
1
import _ from "lodash" ;
2
2
import moment from "moment" ;
3
3
import config from "../../config" ;
4
+ import { PATH_REG_SOURCE_MAP } from "../constants" ;
4
5
5
6
/**
6
7
* Generate Logout URL
@@ -13,10 +14,19 @@ export const getLogoutUrl = () =>
13
14
/**
14
15
* Generate Login URL
15
16
*/
16
- export const getLoginUrl = ( ) =>
17
- `${ config . URL . AUTH } ?retUrl=${ encodeURIComponent (
17
+ export const getLoginUrl = ( ) => {
18
+ let regSource = null ;
19
+ const pathname = window . location . pathname ;
20
+ for ( const { path, regSource : source } of PATH_REG_SOURCE_MAP ) {
21
+ if ( pathname . indexOf ( path ) != - 1 ) {
22
+ regSource = source ;
23
+ }
24
+ }
25
+
26
+ return `${ config . URL . AUTH } ?retUrl=${ encodeURIComponent (
18
27
window . location . href . match ( / [ ^ ? ] * / ) [ 0 ]
19
- ) } `;
28
+ ) } ${ regSource != null ? "®Source=" + regSource : "" } `;
29
+ } ;
20
30
21
31
/**
22
32
* Generate Business Login URL
You can’t perform that action at this time.
0 commit comments