-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #338 from betagouv/resend-email
Renvoi d'un e-mail en cas de non réception
- Loading branch information
Showing
10 changed files
with
130 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
frontend/src/components/SendNewSignupVerificationEmail.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div> | ||
<DsfrButton | ||
secondary | ||
icon="ri-mail-forbid-line" | ||
size="sm" | ||
label="Je n'ai pas reçu d'email" | ||
@click="opened = true" | ||
ref="modalOrigin" | ||
/> | ||
<DsfrModal | ||
:actions="actions" | ||
ref="modal" | ||
:opened="opened" | ||
@close="close" | ||
title="E-mail de vérification non reçu ?" | ||
icon="ri-mail-forbid-line" | ||
> | ||
<p> | ||
Si vous n'avez pas reçu d'email au bout de quelques minutes, veuillez vérifier l'adresse e-mail entrée, ainsi | ||
que vos courriers indésirables. Sinon, cliquez sur le bouton ci-dessous pour recevoir un nouvel e-mail. | ||
</p> | ||
</DsfrModal> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed, ref } from "vue" | ||
import { useFetch } from "@vueuse/core" | ||
import { handleError } from "@/utils/error-handling" | ||
import useToaster from "@/composables/use-toaster" | ||
const props = defineProps({ userId: Number }) | ||
const opened = ref(false) | ||
const close = () => (opened.value = false) | ||
// Main request definition | ||
const url = computed(() => `/api/v1/send-new-signup-verification-email/${props.userId}`) | ||
const { response, execute } = useFetch(url, { | ||
immediate: false, | ||
}).json() | ||
const resendEmail = async () => { | ||
await execute() | ||
await handleError(response) | ||
if (response.value.ok) { | ||
useToaster().addSuccessMessage("L'email de vérification a été renvoyé.") | ||
} | ||
close() | ||
} | ||
const actions = [ | ||
{ | ||
label: "Renvoyer un nouvel e-mail", | ||
onClick: resendEmail, | ||
}, | ||
{ | ||
label: "Annuler", | ||
onClick: close, | ||
secondary: true, | ||
}, | ||
] | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters