Skip to content

Check if email address is already taken#30

Open
pniedzwiedzinski wants to merge 3 commits intomasterfrom
check-email-availability-17692611204635579870
Open

Check if email address is already taken#30
pniedzwiedzinski wants to merge 3 commits intomasterfrom
check-email-availability-17692611204635579870

Conversation

@pniedzwiedzinski
Copy link
Copy Markdown
Member

This change implements a check for email availability during new account requests. If a requested email address is already in use by another user or group in the Google Workspace domain, the request is automatically rejected, and the applicant is notified.

Additionally, it updates the onEdit handler to support a manual workflow where an administrator can resolve email collisions. After correcting an email address in the spreadsheet, an admin can change the status to 'Oczekiwanie na opiekuna' to trigger the confirmation email to the superior.

Fixes #29


PR created automatically by Jules for task 17692611204635579870 started by @pniedzwiedzinski

…s changes

- Update `userExists` in `src/lib/user.ts` to check both users and groups in Admin Directory.
- Create `emailTaken.html` template for notifying users when their desired email is occupied.
- Update `onFormSubmit` in `src/handlers/formHandler.ts` to automatically reject requests for taken emails.
- Update `onEdit` in `src/handlers/editHandler.ts` to allow admins to trigger superior notification by manually changing status to 'Oczekiwanie na opiekuna'.

Co-authored-by: pniedzwiedzinski <19212948+pniedzwiedzinski@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Comment thread src/templates/emailTaken.html Outdated
@@ -0,0 +1,25 @@
<div class="header">
<h1>
Wybrany adres
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Po prostu Adres (adres) jest już zajęty

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zmieniono nagłówek na 'Adres (adres) jest już zajęty'.

Comment thread src/templates/emailTaken.html Outdated
<strong><?= mail ?></strong> jest już zajęty przez innego użytkownika lub grupę.
</p>
<p>
Twój wniosek został automatycznie odrzucony. Prosimy o kontakt z administratorem w celu ustalenia unikalnego adresu e-mail.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lepiej będzie: Twój wniosek został automatycznie odrzucony. Możesz uzupełnić formularz jeszcze raz lub skontaktować się z administratorem z prośbą o nadanie unikalnego adresu e-mail.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zaktualizowano treść o możliwość ponownego wypełnienia formularza.

Comment thread src/templates/emailTaken.html Outdated
Możesz odpowiedzieć bezpośrednio na tę wiadomość.
</p>
<p>
Po ustaleniu nowego adresu, administrator wprowadzi zmiany i prześle wniosek do ponownej weryfikacji.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To usuń - niepotrzebne

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usunięto niepotrzebny fragment.

- Change header to 'Adres (adres) jest już zajęty'
- Update rejection message to mention form resubmission
- Remove redundant paragraph about admin edits

Co-authored-by: pniedzwiedzinski <19212948+pniedzwiedzinski@users.noreply.github.com>
<strong><?= mail ?></strong> jest już zajęty przez innego użytkownika lub grupę.
</p>
<p>
Twój wniosek został automatycznie odrzucony. Możesz uzupełnić formularz jeszcze raz lub skontaktować się z administratorem z prośbą o nadanie unikalnego adresu e-mail.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dodaj jeszcze link do formularza

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dodano link do formularza w treści maila.

- Pass `SURVEY_LINK` to `emailTaken` template in `formHandler.ts`.
- Add button with survey link to `emailTaken.html`.

Co-authored-by: pniedzwiedzinski <19212948+pniedzwiedzinski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check if email address is already taken

1 participant