Skip to content

Commit

Permalink
satellite/{console,web}: fix minor v2 issues
Browse files Browse the repository at this point in the history
This change fixes issues where;
1. Restarting the signup process will not send an updated verification
code.
2. there is text on the add tokens dialog that suggests a paid tier
user is still in free tier.
3. being logged in after account verification will not create the
default project.

Change-Id: I154608efbe485988bacc1cd7b10a9739b0d00bb6
  • Loading branch information
wilfred-asomanii authored and Storj Robot committed Jan 22, 2024
1 parent c7ea51f commit 92df378
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions satellite/console/consoleweb/consoleapi/auth.go
Expand Up @@ -399,6 +399,12 @@ func (a *Auth) Register(w http.ResponseWriter, r *http.Request) {
}

if a.ActivationCodeEnabled {
*user, err = a.service.SetActivationCodeAndSignupID(ctx, *user)
if err != nil {
a.serveJSONError(ctx, w, err)
return
}

a.mailService.SendRenderedAsync(
ctx,
[]post.Address{{Address: user.Email}},
Expand Down
Expand Up @@ -2,7 +2,10 @@
// See LICENSE for copying information.

<template>
<p class="text-body-2 mb-4">
<p v-if="isPaidTier" class="text-body-2 mb-4">
Send STORJ Tokens to the following deposit address to credit your Storj account:
</p>
<p v-else class="text-body-2 mb-4">
Send more than $10 in STORJ Tokens to the following deposit address to upgrade to a Pro account.
Your account will be upgraded after your transaction receives {{ neededConfirmations }} confirmations.
If your account is not automatically upgraded, please fill out this
Expand Down Expand Up @@ -140,6 +143,11 @@ const pendingPayments = computed((): PaymentWithConfirmations[] => {
return billingStore.state.pendingPaymentsWithConfirmations;
});
/**
* Returns whether the user is in paid tier.
*/
const isPaidTier = computed((): boolean => usersStore.state.user.paidTier);
/**
* Copies address to user's clipboard.
*/
Expand Down Expand Up @@ -173,7 +181,7 @@ watch(() => pendingPayments.value, async () => {
clearInterval(intervalID.value);
billingStore.clearPendingPayments();
if (usersStore.state.user.paidTier) {
if (isPaidTier.value) {
// in case this step was entered in to directly from
// the billing/payment method tab when the user is
// already in paid tier.
Expand All @@ -184,7 +192,7 @@ watch(() => pendingPayments.value, async () => {
await usersStore.getUser();
// we redirect to success step only if user status was updated to Paid Tier.
if (usersStore.state.user.paidTier) {
if (isPaidTier.value) {
// arbitrary delay to allow for user to read success banner.
await new Promise(resolve => setTimeout(resolve, 2000));
emit('success');
Expand Down
3 changes: 2 additions & 1 deletion web/satellite/vuetify-poc/src/views/ForgotPassword.vue
Expand Up @@ -58,7 +58,8 @@
color="primary"
size="large"
block
:disabled="isLoading || !formValid"
:loading="isLoading"
:disabled="!formValid"
@click="onPasswordReset"
>
Request Password Reset
Expand Down
4 changes: 4 additions & 0 deletions web/satellite/vuetify-poc/src/views/SignupConfirmation.vue
Expand Up @@ -97,6 +97,7 @@ import { useUsersStore } from '@/store/modules/usersStore';
import { LocalData } from '@/utils/localData';
import { ErrorUnauthorized } from '@/api/errors/ErrorUnauthorized';
import { useAnalyticsStore } from '@/store/modules/analyticsStore';
import { useAppStore } from '@poc/store/appStore';
import IconBlueCheckmark from '@poc/components/icons/IconBlueCheckmark.vue';
Expand All @@ -110,6 +111,7 @@ const props = withDefaults(defineProps<{
const auth: AuthHttpApi = new AuthHttpApi();
const appStore = useAppStore();
const analyticsStore = useAnalyticsStore();
const configStore = useConfigStore();
const usersStore = useUsersStore();
Expand Down Expand Up @@ -170,6 +172,7 @@ function resendMail(): void {
try {
signupId.value = await auth.resendEmail(email);
code.value = '';
} catch (error) {
notify.notifyError(error);
}
Expand Down Expand Up @@ -201,6 +204,7 @@ function verifyCode(): void {
return;
}
appStore.toggleHasJustLoggedIn(true);
usersStore.login();
analyticsStore.pageVisit('/projects');
await router.push('/projects');
Expand Down

0 comments on commit 92df378

Please sign in to comment.