aboutsummaryrefslogtreecommitdiff
path: root/src/site/pages/register.vue
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2020-07-08 04:00:12 +0300
committerZephyrrus <[email protected]>2020-07-08 04:00:12 +0300
commitad852de51a0d2dd5d29c08838d5a430c58849e74 (patch)
treea4ab9a720f66271c9eba10916061a9b06c43656e /src/site/pages/register.vue
parentrefactor: refactor grid to use vuex for every action (diff)
downloadhost.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.tar.xz
host.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.zip
chore: linter the entire project using the new rules
Diffstat (limited to 'src/site/pages/register.vue')
-rw-r--r--src/site/pages/register.vue37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/site/pages/register.vue b/src/site/pages/register.vue
index 92eb35a..1216dc1 100644
--- a/src/site/pages/register.vue
+++ b/src/site/pages/register.vue
@@ -10,18 +10,21 @@
<div class="columns">
<div class="column is-4 is-offset-4">
<b-field>
- <b-input v-model="username"
+ <b-input
+ v-model="username"
type="text"
placeholder="Username" />
</b-field>
<b-field>
- <b-input v-model="password"
+ <b-input
+ v-model="password"
type="password"
placeholder="Password"
password-reveal />
</b-field>
<b-field>
- <b-input v-model="rePassword"
+ <b-input
+ v-model="rePassword"
type="password"
placeholder="Re-type Password"
password-reveal
@@ -29,11 +32,17 @@
</b-field>
<p class="control has-addons is-pulled-right">
- <router-link to="/login"
- class="is-text">Already have an account?</router-link>
- <button class="button is-primary big ml1"
+ <router-link
+ to="/login"
+ class="is-text">
+ Already have an account?
+ </router-link>
+ <button
+ class="button is-primary big ml1"
:disabled="isLoading"
- @click="register">Register</button>
+ @click="register">
+ Register
+ </button>
</p>
</div>
</div>
@@ -51,7 +60,7 @@ export default {
username: null,
password: null,
rePassword: null,
- isLoading: false
+ isLoading: false,
};
},
computed: mapState(['config', 'auth']),
@@ -64,23 +73,23 @@ export default {
if (!this.username || !this.password || !this.rePassword) {
this.$store.dispatch('alert', {
text: 'Please fill all fields before attempting to register.',
- error: true
+ error: true,
});
return;
}
if (this.password !== this.rePassword) {
this.$store.dispatch('alert', {
text: "Passwords don't match",
- error: true
+ error: true,
});
return;
}
this.isLoading = true;
try {
- const response = await this.$axios.$post(`auth/register`, {
+ const response = await this.$axios.$post('auth/register', {
username: this.username,
- password: this.password
+ password: this.password,
});
this.$store.dispatch('alert', { text: response.message });
@@ -90,7 +99,7 @@ export default {
} finally {
this.isLoading = false;
}
- }
- }
+ },
+ },
};
</script>