← back to Ventura Claw Leads

views/public/accept-invite.ejs

34 lines

<%- include('../partials/head', { title }) %>
<%- include('../partials/header') %>

<section class="long-form">
  <% if (!ok) { %>
    <p class="kicker">Invitation not valid</p>
    <h1 class="display-sm">This invite can't be used.</h1>
    <p class="lede"><%
      if (reason === 'expired') { %>The 7-day window expired. Ask whoever invited you to send a new invitation.<%
      } else if (reason === 'already_used') { %>This invitation has already been accepted — sign in below.<%
      } else { %>The link is malformed or doesn't match a current invitation.<%
      } %></p>
    <p style="margin-top:24px"><a href="/admin/login" class="btn btn-primary">Sign in</a> &nbsp; <a href="/find" class="btn btn-ghost">Browse the directory</a></p>
  <% } else { %>
    <p class="kicker">Invitation · <%= invite.business_name %></p>
    <h1 class="display-sm">Set a password to join the team.</h1>
    <p class="lede"><strong><%= invite.inviter_name || invite.inviter_email %></strong> invited you to manage <strong><%= invite.business_name %></strong> on Ventura Claw. Once you set a password, you'll be signed in and dropped on the dashboard alongside the existing team.</p>

    <% if (error) { %>
      <p class="callout" style="background:#fee2e2;border-left:3px solid #dc2626;padding:12px 16px;margin:16px 0;border-radius:4px"><%= error %></p>
    <% } %>

    <form method="post" action="/accept-invite/<%= encodeURIComponent(token) %>" style="margin-top:24px;max-width:420px">
      <input type="hidden" name="_csrf" value="<%= csrfToken %>">
      <label>Email<input type="email" value="<%= invite.email %>" disabled style="background:var(--bg-alt);color:var(--fg-muted)"></label>
      <label>Password (10+ characters)<input type="password" name="password" required minlength="10" autocomplete="new-password"></label>
      <label>Confirm password<input type="password" name="password_confirm" required minlength="10" autocomplete="new-password"></label>
      <button type="submit" class="btn btn-primary btn-lg" style="margin-top:8px">Join <%= invite.business_name %> →</button>
    </form>
  <% } %>
</section>

<%- include('../partials/footer') %>