Add e2e seed and test event creation
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
<h1 class="title">
|
||||
{{ $t('Register an account on Mobilizon!') }}
|
||||
</h1>
|
||||
<form v-if="!validationSent">
|
||||
<b-message v-if="userAlreadyActivated">
|
||||
{{ $t('To achieve your registration, please create a first identity profile.')}}
|
||||
</b-message>
|
||||
<form v-if="!validationSent" @submit.prevent="submit">
|
||||
<b-field
|
||||
:label="$t('Username')"
|
||||
:type="errors.preferred_username ? 'is-danger' : null"
|
||||
@@ -33,7 +36,7 @@
|
||||
</b-field>
|
||||
|
||||
<p class="control has-text-centered">
|
||||
<b-button type="is-primary" size="is-large" @click="submit()">
|
||||
<b-button type="is-primary" size="is-large" native-type="submit">
|
||||
{{ $t('Create my profile') }}
|
||||
</b-button>
|
||||
</p>
|
||||
@@ -117,8 +120,8 @@ export default class Register extends Vue {
|
||||
acc[error.details] = error.message;
|
||||
return acc;
|
||||
}, {});
|
||||
console.error(error);
|
||||
console.error(this.errors);
|
||||
console.error('Error while registering person', error);
|
||||
console.error('Errors while registering person', this.errors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||
import { LOGIN } from '@/graphql/auth';
|
||||
import { validateEmailField, validateRequiredField } from '@/utils/validators';
|
||||
import { initializeCurrentActor, saveUserData } from '@/utils/auth';
|
||||
import { initializeCurrentActor, NoIdentitiesException, saveUserData } from '@/utils/auth';
|
||||
import { ILogin } from '@/types/login.model';
|
||||
import { CURRENT_USER_CLIENT, UPDATE_CURRENT_USER_CLIENT } from '@/graphql/user';
|
||||
import { onLogin } from '@/vue-apollo';
|
||||
@@ -153,7 +153,16 @@ export default class Login extends Vue {
|
||||
role: data.login.user.role,
|
||||
},
|
||||
});
|
||||
await initializeCurrentActor(this.$apollo.provider.defaultClient);
|
||||
try {
|
||||
await initializeCurrentActor(this.$apollo.provider.defaultClient);
|
||||
} catch (e) {
|
||||
if (e instanceof NoIdentitiesException) {
|
||||
return await this.$router.push({
|
||||
name: RouteName.REGISTER_PROFILE,
|
||||
params: { email: this.currentUser.email, userAlreadyActivated: 'true' },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onLogin(this.$apollo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user