Skip to content
Snippets Groups Projects
Commit afb0646b authored by V S Tharunika's avatar V S Tharunika
Browse files

the error will be reflected in the frontend

parent 50cc2361
Branches
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@
<br>
<input type="password" name="password" v-model="password" placeholder="password"/>
<br>
<div class="error" v-html ="error"/>
<br>
<button @click="register">Register</button>
</div>
</template>
......@@ -17,18 +19,23 @@ export default {
data () {
return {
email:'',
password:''
password:'',
error: null
}
},
methods:{
async register(){
try{
await AuthentiacationService.register({
email: this.email,
password:this.password
})
}catch(error) {
this.error = error.response.data.error
}
}
}
......@@ -38,4 +45,8 @@ export default {
<style scoped>
.error{
color:red;
}
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment