Skip to content

Commit 771c993

Browse files
authored
Merge pull request #26 from devanooga/feature/better-signup-error-messages
Feature/better signup error messages
2 parents cd7757a + d5772fe commit 771c993

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

vue/src/views/home/index.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</h1>
66
<h2>Join the Devanooga Community</h2>
77
</div>
8-
<div class="error" v-if="showAlreadyInTeamMessage">
9-
This e-mail address is already a member of the community.
8+
<div class="error" v-if="error">
9+
{{ error }}
1010
</div>
1111
<div class="content">
1212
<div class="information">
@@ -43,11 +43,11 @@ export default defineComponent({
4343
const { executeRecaptcha, recaptchaLoaded } =
4444
useReCaptcha() as IReCaptchaComposition;
4545
const email = ref("");
46-
const showAlreadyInTeamMessage = ref(false);
46+
const error = ref<string | null>(null);
4747
const signupAccepted = ref(false);
4848
await recaptchaLoaded();
4949
async function signup() {
50-
showAlreadyInTeamMessage.value = false;
50+
error.value = null;
5151
signupAccepted.value = false;
5252
await axios
5353
.post("/api/v0/signup", {
@@ -60,11 +60,15 @@ async function signup() {
6060
.catch((error) => {
6161
switch (error.response.data.error) {
6262
case "already_in_team":
63-
showAlreadyInTeamMessage.value = true;
63+
error.value =
64+
"This e-mail address is already a member of the community, if you need an invite resent please contact us via our contact form.";
6465
break;
6566
case "token_verification_failed":
66-
alert("wat");
67+
error.value =
68+
"Slack sign-up failed -- Slack returned an unexpected error code, this may be a temporary issue, please try again in a minute, if the issue persists please reach out to us via our contact form!";
6769
break;
70+
default:
71+
error.value = `Unexpected error code from Slack: ${error.response.data.error}, please report this error via our contact form and we'll send you an invite manually!`;
6872
}
6973
});
7074
}

0 commit comments

Comments
 (0)