mirror of
https://github.com/outline/outline.git
synced 2026-08-03 13:27:25 +03:00
chore: Remove client boolean guard in redirectOnClient (#13136)
This commit is contained in:
@@ -29,13 +29,23 @@ export function redirectOnClient(
|
||||
)}" value="${escape(value)}" />`;
|
||||
});
|
||||
|
||||
if (this.userAgent.isBot) {
|
||||
// Bots are shown a manual submit button instead of auto-submitting, so that
|
||||
// link scanners in email clients don't follow the redirect.
|
||||
const isBot = this.userAgent.isBot;
|
||||
|
||||
if (isBot) {
|
||||
formFields += `
|
||||
<p>If you are not redirected automatically, please click the button below.</p>
|
||||
<input type="submit" value="Continue" />
|
||||
`;
|
||||
}
|
||||
|
||||
const script = isBot
|
||||
? ""
|
||||
: `<script nonce="${this.state.cspNonce}">
|
||||
document.getElementById('redirect-form').submit();
|
||||
</script>`;
|
||||
|
||||
this.body = `
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -45,9 +55,7 @@ export function redirectOnClient(
|
||||
<form id="redirect-form" method="POST" action="${formAction}">
|
||||
${formFields}
|
||||
</form>
|
||||
<script nonce="${this.state.cspNonce}">
|
||||
${!this.userAgent.isBot} && document.getElementById('redirect-form').submit();
|
||||
</script>
|
||||
${script}
|
||||
</body>
|
||||
</html>`;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user