rastrillo / idear Public

Clone
git clone https://amadan.net/rastrillo/idear

Plain git — no account needed to clone.

Download

Download this file

1{{define "content"}}
2<h1>Invitation</h1>
3{{with .Content}}
4{{if .Error}}
5<p data-error>{{.Error}}</p>
6{{else if .Reconcile}}
7{{/* Signed in, but with no roster row: the orphan this route exists
8 to heal. Accepting spends the token and writes the membership
9 against the session already in hand. */}}
10<p>You are invited to {{.Site}} as {{.Role.Title}}.</p>
11<form method="post" action="/invitations/{{.Token}}"><button type="submit">Accept</button></form>
12{{else if .SignedIn}}
13<p>You are already a member of {{.Site}}. <a href="/">Go to the board</a>.</p>
14{{else}}
15{{/* The invitation page never says WHO was invited: idear hands this
16 template no address, so it cannot leak one to whoever found the
17 link. The token rides the hidden field below, which is what
18 idear's CarryToken reads off the POST. */}}
19<p>You are invited to {{.Site}} as {{.Role.Title}}. Create your account:</p>
20<form method="post" action="/signup">
21<input type="hidden" name="invite" value="{{.Token}}">
22<label>Email <input type="email" name="email" required autocomplete="username"></label>
23<label>Password <input type="password" name="password" required minlength="8" autocomplete="new-password"></label>
24<button type="submit">Sign up</button>
25</form>
26{{end}}
27{{end}}
28{{end}}
29