Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update request reset password message #37

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/js/components/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const tokenName = ref();
const walletAccount = ref(publicKeyToAddress(appStore.user?.account));
const enableTokenCreate = ref(false);
const enableAccountModify = ref(false);
const loading = ref(true);
const loading = ref(appStore.user ? false : true);

const tokens = computed(() => appStore.user?.apiTokens);

Expand Down
20 changes: 6 additions & 14 deletions resources/js/components/pages/auth/RequestResetPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import * as yup from 'yup';
import EnjinLogo from '~/components/EnjinLogo.vue';
import { AuthApi } from '~/api/auth';
import snackbar from '~/util/snackbar';
import { snackbarErrors } from '~/util';
import { ArrowLeftIcon } from '@heroicons/vue/20/solid';

const router = useRouter();
Expand All @@ -77,19 +76,12 @@ const requestReset = async () => {
if (!(await isValid())) return;

isLoading.value = true;
try {
const res = await AuthApi.requestPasswordReset(email.value);
if (res.data.RequestPasswordReset === true) {
snackbar.success({ title: 'Password reset link sent', save: false });
} else {
snackbar.error({ title: 'Error sending password reset link' });
}
} catch (e) {
if (snackbarErrors(e)) return;
snackbar.error({ title: 'Error sending password reset link' });
} finally {
isLoading.value = false;
}
await AuthApi.requestPasswordReset(email.value);
snackbar.success({
title: "If an account with this email exists, you'll receive an email shortly with information on resetting your password.",
save: false,
});
isLoading.value = false;
};

(async () => {
Expand Down
Loading