From a5918f0f4ebb3a0fb1fef1bb3ceeabd1ade2ae93 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 15 Sep 2022 16:55:52 +0200 Subject: Signup page --- pages/signin.vue | 2 +- pages/signup.vue | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ store/auth.js | 4 ++ 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 pages/signup.vue diff --git a/pages/signin.vue b/pages/signin.vue index 66d09f0..4215204 100644 --- a/pages/signin.vue +++ b/pages/signin.vue @@ -14,7 +14,7 @@ .-space-y-px.rounded-md.shadow-sm div label.sr-only(for="username") Username - input#username.relative.block.w-full.appearance-none.rounded-none.rounded-t-md.border.border-gray-300.px-3.py-2.text-gray-900.placeholder-gray-500(name="text" type="text" autocomplete="username" required class="focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" placeholder="Username" v-model="form.username") + input#username.relative.block.w-full.appearance-none.rounded-none.rounded-t-md.border.border-gray-300.px-3.py-2.text-gray-900.placeholder-gray-500(name="username" type="text" autocomplete="username" required class="focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" placeholder="Username" v-model="form.username") div label.sr-only(for="password") Password input#password.relative.block.w-full.appearance-none.rounded-none.rounded-b-md.border.border-gray-300.px-3.py-2.text-gray-900.placeholder-gray-500(name="password" type="password" autocomplete="current-password" required class="focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" placeholder="Password" v-model="form.password") diff --git a/pages/signup.vue b/pages/signup.vue new file mode 100644 index 0000000..c2e6115 --- /dev/null +++ b/pages/signup.vue @@ -0,0 +1,119 @@ + + + diff --git a/store/auth.js b/store/auth.js index dbf989f..9158fb0 100644 --- a/store/auth.js +++ b/store/auth.js @@ -76,6 +76,10 @@ export const actions = { .then(async (response) => { res.data = await response.json(); res.status = response.status; + + if (res.status == 201) { + commit("saveAccessToken", res.data.access_token); + } }) .catch((e) => { res.status = e.status; -- cgit v1.2.3-18-g5258