Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/components/Signup.vue
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | <div class="container"> | ||||
<button class="btn btn-primary" type="submit">Submit</button> | <button class="btn btn-primary" type="submit">Submit</button> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import store from '../js/store' | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
email: '', | email: '', | ||||
name: '', | name: '', | ||||
code: '', | code: '', | ||||
short_code: '', | short_code: '', | ||||
login: '', | login: '', | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | export default { | ||||
code: this.code, | code: this.code, | ||||
short_code: this.short_code, | short_code: this.short_code, | ||||
login: this.login, | login: this.login, | ||||
domain: this.domain, | domain: this.domain, | ||||
password: this.password, | password: this.password, | ||||
password_confirmation: this.password_confirmation | password_confirmation: this.password_confirmation | ||||
}).then(response => { | }).then(response => { | ||||
// auto-login and goto dashboard | // auto-login and goto dashboard | ||||
store.commit('loginUser') | this.$root.loginUser(response.data.access_token) | ||||
localStorage.setItem('token', response.data.access_token) | |||||
this.$router.push({name: 'dashboard'}) | |||||
}) | }) | ||||
}, | }, | ||||
// Moves the user a step back in registration form | // Moves the user a step back in registration form | ||||
stepBack(e) { | stepBack(e) { | ||||
var card = $(e.target).closest('.card') | var card = $(e.target).closest('.card') | ||||
card.prev().removeClass('d-none').find('input').first().focus() | card.prev().removeClass('d-none').find('input').first().focus() | ||||
card.addClass('d-none').find('form')[0].reset() | card.addClass('d-none').find('form')[0].reset() | ||||
Show All 24 Lines |