sign up almost fully working

This commit is contained in:
2023-08-05 11:52:29 +02:00
parent d9adc91256
commit f9e6b8fc17
10 changed files with 379 additions and 11 deletions

View File

@@ -5,6 +5,8 @@
- create function that parses DB every 15 minutes and clears out junk
- Require user to confirm email before purchasing
- Create password changing endpoint (to reset forgotten pwd)
- Add Admin profile (page to change account settings per person like changing pwd)

View File

@@ -50,7 +50,11 @@
res.json().then( data => {
if ( data.status ) {
this.accountData = data.data;
console.log( data.data );
if ( !data.data.mail_confirmed ) {
setTimeout( () => {
this.$refs.notification.createNotification( 'Your account is unverified. Please confirm your email using the link we have sent to your email!', 20, 'info', 'normal' );
}, 1000 );
}
} else {
this.userStore.setUserAuth( false );
this.userStore.setUser2fa( false );

View File

@@ -108,9 +108,13 @@
console.log( res );
res.text().then( status => {
if ( status === 'ok' ) {
this.userStore.setUserAuth( true );
this.$router.push( sessionStorage.getItem( 'redirect' ) ?? '/account' );
sessionStorage.removeItem( 'redirect' );
this.$refs.notification.cancelNotification( progress );
this.$refs.notification.createNotification( 'Signed up successfully. We have sent you an email. Please confirm it to finish sign-up', 5, 'ok', 'normal' );
setTimeout( () => {
this.userStore.setUserAuth( true );
this.$router.push( sessionStorage.getItem( 'redirect' ) ?? '/account' );
sessionStorage.removeItem( 'redirect' );
}, 5000 );
} else if ( status === 'exists' ) {
this.$refs.notification.cancelNotification( progress );
this.$refs.notification.createNotification( 'An account with this email address already exists. Please log in using it.', 5, 'error', 'normal' );