mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-22 21:45:56 +03:00
fix(auth): skipping special characters in the email query param
This commit is contained in:
parent
20d17b1881
commit
6590a3a096
@ -103,7 +103,9 @@ export default class CTATransition extends React.Component {
|
|||||||
const currentURL = Strings.getCurrentURL(this.props.page?.params);
|
const currentURL = Strings.getCurrentURL(this.props.page?.params);
|
||||||
this.props.onAction({
|
this.props.onAction({
|
||||||
type: "NAVIGATE",
|
type: "NAVIGATE",
|
||||||
href: `/_/auth?tab=signin&email=${emailOrUsername}&redirect=${encodeURI(currentURL)}`,
|
href: `/_/auth?tab=signin&email=${encodeURIComponent(emailOrUsername)}&redirect=${encodeURI(
|
||||||
|
currentURL
|
||||||
|
)}`,
|
||||||
});
|
});
|
||||||
this._handleClose();
|
this._handleClose();
|
||||||
};
|
};
|
||||||
@ -112,7 +114,9 @@ export default class CTATransition extends React.Component {
|
|||||||
const currentURL = Strings.getCurrentURL(this.props.page?.params);
|
const currentURL = Strings.getCurrentURL(this.props.page?.params);
|
||||||
this.props.onAction({
|
this.props.onAction({
|
||||||
type: "NAVIGATE",
|
type: "NAVIGATE",
|
||||||
href: `/_/auth?tab=signup&email=${email}&redirect=${encodeURI(currentURL)}`,
|
href: `/_/auth?tab=signup&email=${encodeURIComponent(email)}&redirect=${encodeURI(
|
||||||
|
currentURL
|
||||||
|
)}`,
|
||||||
});
|
});
|
||||||
this._handleClose();
|
this._handleClose();
|
||||||
};
|
};
|
||||||
|
@ -847,7 +847,7 @@ export default function IndexPage() {
|
|||||||
return errors;
|
return errors;
|
||||||
},
|
},
|
||||||
onSubmit: async ({ email }) => {
|
onSubmit: async ({ email }) => {
|
||||||
window.open(`/_/auth?tab=signup&email=${email}`, "_self");
|
window.open(`/_/auth?tab=signup&email=${encodeURIComponent(email)}`, "_self");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -161,10 +161,9 @@ const AuthScene = ({ onAuthenticate, onTwitterAuthenticate, page, onAction, ...p
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// NOTE(amine): if the user goes back, we should prefill the email
|
// NOTE(amine): if the user goes back, we should prefill the email
|
||||||
|
const emailParam = page?.params?.email ? decodeURIComponent(page?.params?.email) : "";
|
||||||
const initialEmail =
|
const initialEmail =
|
||||||
prevScene === "signin" && context.emailOrUsername
|
prevScene === "signin" && context.emailOrUsername ? context.emailOrUsername : emailParam;
|
||||||
? context.emailOrUsername
|
|
||||||
: page?.params?.email || "";
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Initial
|
<Initial
|
||||||
|
Loading…
Reference in New Issue
Block a user