site icon indicating copy to clipboard operation
site copied to clipboard

HCB Application Form: Deter use of shared email addresses

Open garyhtou opened this issue 2 years ago • 7 comments

We already deter users from inviting shared email addresses on HCB. image

We should do the same with the application form. This is because emails collected via the form are automatically invited to HCB. image

garyhtou avatar Feb 20 '24 06:02 garyhtou

Hey! I would love to work on this issue too @garyhtou.

Chay2203 avatar Mar 07 '24 06:03 Chay2203

Go for it! Here is the updated copy that we use on HCB

⚠️ For security, we discourage team emails on HCB. We recommend individual emails such as [email protected]!

garyhtou avatar Mar 14 '24 02:03 garyhtou

Hey @garyhtou, can you comment on the links of the above page where the warning must be added and the source page where it is already being implemented?

Chay2203 avatar Mar 15 '24 05:03 Chay2203

Hi @Chay2203!

Warning should be implemented here https://github.com/hackclub/site/blob/905b84666101df3a0bfa2960ba62f745e1e141ee/components/fiscal-sponsorship/apply/personal-form.js#L26-L33

The existing implementation is unfortunately in a closed source codebase.

garyhtou avatar Mar 15 '24 06:03 garyhtou

Sure, works!

Chay2203 avatar Mar 15 '24 06:03 Chay2203

Here's the closed-source implementation. You can use it as a guide, however, the implementation we want here will likely be different.

  <div x-data="{ email: '' }">
    <div class="field flex items-end">
      <div class="mr2 flex-auto">
        <%= form.label :email %>
        <%= form.email_field :email, "x-model": "email" %>
      </div>
      <%= form.submit "Send" %>
    </div>
    <template x-if="/^(team|webmaster|marketing|admin|info|about|support|sales|hq|hello)@/.test(email)">
      <div class="warning mt1">⚠️ For security, we discourage team emails on HCB. We recommend individual emails such as <em>[email protected]</em>!</div>
    </template>
  </div>

^ This implementation uses Alpine.js

garyhtou avatar Mar 15 '24 07:03 garyhtou

Sure, will look at it

Chay2203 avatar Mar 15 '24 07:03 Chay2203

We're planning to move this form in house @ https://github.com/hackclub/hcb

garyhtou avatar Aug 06 '24 00:08 garyhtou