File tree 10 files changed +15
-15
lines changed
10 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ class Article extends React.Component {
139
139
} = this . state || { } ;
140
140
let shareUrl ;
141
141
if ( isomorphy . isClientSide ( ) ) {
142
- shareUrl = encodeURIComponent ( window . location . href ) ;
142
+ shareUrl = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
143
143
}
144
144
const description = htmlToText . fromString (
145
145
ReactDOMServer . renderToString ( markdown ( fields . content ) ) ,
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export default function GigApply(props) {
36
36
recruitProfile,
37
37
auth,
38
38
} = props ;
39
- const retUrl = window . location . href ;
39
+ const retUrl = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
40
40
const duration = getCustomField ( job . custom_fields , 'Duration' ) ;
41
41
const isPlaced = _ . find ( _ . isEmpty ( recruitProfile ) ? [ ] : recruitProfile . custom_fields , { field_id : 12 } ) ;
42
42
const fetchSkills = useMemo ( ( ) => _ . debounce ( ( inputValue , callback ) => {
@@ -353,9 +353,9 @@ export default function GigApply(props) {
353
353
< div styleName = "error" >
354
354
< h3 > You must be a Topcoder member to apply!</ h3 >
355
355
< div styleName = "cta-buttons" >
356
- < Link to = { `${ config . URL . AUTH } /member?retUrl=${ encodeURIComponent ( retUrl ) } ` } styleName = "primaryBtn" > Login</ Link >
356
+ < Link to = { `${ config . URL . AUTH } /member?retUrl=${ retUrl } ` } styleName = "primaryBtn" > Login</ Link >
357
357
</ div >
358
- < p styleName = "regTxt" > Not a member? Register < a href = { `${ config . URL . AUTH } /?retUrl=${ encodeURIComponent ( retUrl ) } &mode=signUp&utm_source=gig_listing®Source=gigs` } > here</ a > .</ p >
358
+ < p styleName = "regTxt" > Not a member? Register < a href = { `${ config . URL . AUTH } /?retUrl=${ retUrl } &mode=signUp&utm_source=gig_listing®Source=gigs` } > here</ a > .</ p >
359
359
</ div >
360
360
</ div >
361
361
</ div >
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export default function Auth({ column }) {
28
28
className = "tc-btn-sm tc-btn-default"
29
29
href = { `${ config . URL . AUTH } /member?utm_source=community-app-main` }
30
30
onClick = { ( event ) => {
31
- const retUrl = encodeURIComponent ( window . location . href ) ;
31
+ const retUrl = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
32
32
window . location = `${ config . URL . AUTH } /member?retUrl=${ retUrl } &utm_source=community-app-main` ;
33
33
event . preventDefault ( ) ;
34
34
} }
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export default function AccessDenied(props) {
50
50
className = "tc-btn-md tc-btn-primary"
51
51
href = { `${ config . URL . AUTH } /member?utm_source=${ communityId } ` }
52
52
onClick = { ( event ) => {
53
- const retUrl = encodeURIComponent ( window . location . href ) ;
53
+ const retUrl = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
54
54
window . location = `${ config . URL . AUTH } /member?retUrl=${ retUrl } &utm_source=${ communityId } ` ;
55
55
event . preventDefault ( ) ;
56
56
} }
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ function Footer({
56
56
< button
57
57
className = { theme . btnRegister }
58
58
onClick = { ( ) => {
59
- const url = encodeURIComponent ( window . location . href ) ;
59
+ const url = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
60
60
window . location = `${ config . URL . AUTH } /member/registration?retUrl=${ url } &utm_source=${ communityId } ` ;
61
61
} }
62
62
type = "button"
@@ -66,7 +66,7 @@ function Footer({
66
66
< button
67
67
className = { theme . btnLogin }
68
68
onClick = { ( ) => {
69
- const url = encodeURIComponent ( window . location . href ) ;
69
+ const url = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
70
70
window . location = `${ config . URL . AUTH } /member?retUrl=${ url } &utm_source=${ communityId } ` ;
71
71
} }
72
72
type = "button"
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ function Header(props) {
172
172
communityId === 'zurich' ? (
173
173
< PrimaryButton
174
174
onClick = { ( ) => {
175
- const returnUrl = encodeURIComponent ( window . location . href ) ;
175
+ const returnUrl = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
176
176
window . location = `${ config . URL . AUTH } /sso-login/?retUrl=${ returnUrl } &utm_source=${ communityId } ` ;
177
177
} }
178
178
size = "sm"
@@ -184,7 +184,7 @@ function Header(props) {
184
184
) : (
185
185
< Button
186
186
onClick = { ( ) => {
187
- const url = encodeURIComponent ( `${ window . location . href } ?join=${ groupIds [ 0 ] } ` ) ;
187
+ const url = encodeURIComponent ( `${ window . location . origin } ${ window . location . pathname } ?join=${ groupIds [ 0 ] } ` ) ;
188
188
window . location = `${ config . URL . AUTH } /member?retUrl=${ url } &utm_source=${ communityId } ` ;
189
189
} }
190
190
size = "sm"
@@ -196,7 +196,7 @@ function Header(props) {
196
196
{ hideJoinNow ? null : (
197
197
< PrimaryButton
198
198
onClick = { ( ) => {
199
- let url = encodeURIComponent ( `${ window . location . href } ?join=${ groupIds [ 0 ] } ` ) ;
199
+ let url = encodeURIComponent ( `${ window . location . origin } ${ window . location . pathname } ?join=${ groupIds [ 0 ] } ` ) ;
200
200
url = encodeURIComponent ( `${ config . URL . AUTH } /member?retUrl=${ url } &utm_source=${ communityId } ` ) ;
201
201
url = encodeURIComponent ( url ) ;
202
202
window . location = `${ config . URL . AUTH } /member/registration?retUrl=${ url } &utm_source=${ communityId } ` ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function SlashTCContainer(props) {
42
42
43
43
useEffect ( ( ) => {
44
44
if ( props . tokenV3 && ! isTokenExpired ( props . tokenV3 ) ) return ;
45
- let url = `retUrl=${ encodeURIComponent ( location . href ) } ` ;
45
+ let url = `retUrl=${ encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) } ` ;
46
46
url = `${ config . URL . AUTH } /member?${ url } &utm_source=community-app-home-page` ;
47
47
location . href = url ;
48
48
} , [ props . tokenV3 ] ) ;
Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ class ChallengeDetailPageContainer extends React.Component {
327
327
} = this . props ;
328
328
if ( ! auth . tokenV3 ) {
329
329
const utmSource = communityId || 'community-app-main' ;
330
- window . location . href = `${ config . URL . AUTH } /member?retUrl=${ encodeURIComponent ( window . location . href ) } &utm_source=${ utmSource } ®Source=challenges` ;
330
+ window . location . href = `${ config . URL . AUTH } /member?retUrl=${ encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) } &utm_source=${ utmSource } ®Source=challenges` ;
331
331
} else {
332
332
// Show security reminder to all registrants
333
333
this . setState ( {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class Loader extends React.Component {
42
42
visitorGroups,
43
43
} = this . props ;
44
44
45
- const returnUrl = encodeURIComponent ( window . location . href ) ;
45
+ const returnUrl = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
46
46
47
47
if ( ! loadingMeta && (
48
48
! meta /* || (Date.now() - meta.timestamp) > MAXAGE */
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ export async function getM2mToken() {
212
212
*/
213
213
export function goToLogin ( utmSource = '' ) {
214
214
if ( isomorphy . isClientSide ( ) ) {
215
- const retUrl = encodeURIComponent ( window . location . href ) ;
215
+ const retUrl = encodeURIComponent ( ` ${ window . location . origin } ${ window . location . pathname } ` ) ;
216
216
window . location = `${ config . URL . AUTH } /member?retUrl=${ retUrl } &utm_source=${ utmSource } ` ;
217
217
}
218
218
}
You can’t perform that action at this time.
0 commit comments