Skip to content

Commit

Permalink
Step 21.11: Add code verification method
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela authored and DAB0mB committed Dec 14, 2016
1 parent b65f8db commit 8d88045
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion imports/ui/components/login/mobile.js
@@ -1,9 +1,11 @@
import { Accounts } from 'meteor/accounts-base';

export class Login {
constructor($scope, $reactive) {
constructor($scope, $reactive, $state) {
'ngInject';

this.$state = $state;

$reactive(this).attach($scope);

this.isStepTwo = false;
Expand All @@ -24,4 +26,15 @@ export class Login {
}
}));
}

verifyCode() {
Accounts.verifyPhone(this.phoneNumber, this.verificationCode, this.$bindToContext((err) => {
if (err) {
this.error = err.reason || err;
} else {
// redirect to parties list
this.$state.go('parties');
}
}));
}
}

0 comments on commit 8d88045

Please sign in to comment.