Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/components/PasswordReset.vue
Show First 20 Lines • Show All 52 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: '', | ||||
code: '', | code: '', | ||||
short_code: '', | short_code: '', | ||||
password: '', | password: '', | ||||
password_confirmation: '' | password_confirmation: '' | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | export default { | ||||
axios.post('/api/auth/password-reset', { | axios.post('/api/auth/password-reset', { | ||||
code: this.code, | code: this.code, | ||||
short_code: this.short_code, | short_code: this.short_code, | ||||
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 15 Lines |