Fix origin and add email login note to login page
This commit is contained in:
parent
4ed2d68d17
commit
52a329135e
|
@ -223,9 +223,10 @@ router.get("/keys", (req, res) => {
|
|||
|
||||
router.post("/keys/email", async (req, res) => {
|
||||
const email = req.body.email;
|
||||
const origin = req.body.origin;
|
||||
|
||||
let html = await ejs.renderFile("views/email_sign_in.ejs", {
|
||||
host: `http://${req.headers.host}`,
|
||||
origin,
|
||||
ssb_key: req.cookies["ssb_key"],
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.3em; font-size: 16px; padding: 30px 0">
|
||||
<h1 style="font-weight: bold; line-height: 1.3em; margin: 0; padding: 10px 0 0 0; font-weight: 200;">Login button</h1>
|
||||
<p>Welcome to Social, please use the button below to login to your account:</p>
|
||||
<form action="<%= host %>/login" method="POST" style="padding: 20px 0">
|
||||
<form action="<%= origin %>/login" method="POST" style="padding: 20px 0">
|
||||
<input type="hidden" name="ssb_key" value="<%= ssb_key %>" />
|
||||
<input type="submit" value="Login to Social" style="background: #08d; color: #fff; border-radius: 3px; padding: 8px 10px; border: none; cursor: pointer; text-decoration: none; display: inline-block; padding: 16px 20px; font-size: 18px;">
|
||||
</form>
|
||||
|
|
|
@ -16,8 +16,13 @@
|
|||
<form action="/keys/email" method="POST">
|
||||
<div style="padding: 20px 0 30px 0">
|
||||
<label>
|
||||
<input type="hidden" name="origin" id="origin" />
|
||||
<script>
|
||||
const origin = document.querySelector("#origin");
|
||||
origin.value = window.location.origin;
|
||||
</script>
|
||||
Email: <br />
|
||||
<input type="email" name="email">
|
||||
<input type="email" name="email" />
|
||||
</label>
|
||||
</div>
|
||||
<input class="button-big" type="submit" value="Send">
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
<div style="max-width: 800px; margin: 0 auto">
|
||||
<h1 style="padding-top: 50px">Login</h1>
|
||||
|
||||
<p style="padding-top: 15px">
|
||||
You should probably have received your login button by email, search for "Social login button", if not, then you must have saved your key, you can input it here
|
||||
</p>
|
||||
|
||||
<form method="POST" action="/login" enctype="multipart/form-data">
|
||||
<div style="padding: 20px 0 10px 0">
|
||||
<label>
|
||||
|
|
Loading…
Reference in New Issue