November 2017
Beginner to intermediate
398 pages
8h 42m
English
We will start with the account creation, since we don't have any user yet. The path to call on the server is /signup, and it expects a POST request with a JSON object in the request body containing the username, password, and email of the new account:
Let's implement this using the $fetch method we just improved:
async signup () { await this.$fetch('signup', { method: 'POST', body: JSON.stringify({ username: this.username, password: this.password, email: this.email, }), }) this.mode = 'login'},
That's it! You can now create a new account with a simple password you will have to remember for later. If the account creation succeeds, the ...
Read now
Unlock full access