-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b57df3
commit d34558a
Showing
13 changed files
with
129 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,19 @@ const twilioClient = require('twilio')(config.accountSid, config.authToken); | |
let auth = {}; | ||
|
||
auth.sendAuthyToken = function(user, successCallback, errorCallback) { | ||
let AuthyUser = { email: '[email protected]', cellphone: user.mobile, countryCode: user.countryCode} | ||
|
||
if (!user.authyId) { | ||
// Register this user if it's a new user | ||
authy.register_user(AuthyUser.email, AuthyUser.cellphone, AuthyUser.countryCode, | ||
authy.register_user('[email protected]', user.mobile, user.countryCode, | ||
function(err, response) { | ||
if (err || !response.user) return errorCallback(err); | ||
user.authyId = response.user.id; | ||
console.log('registering new user'); | ||
// successCallback(response, user.authyId); | ||
sendToken(); | ||
}); | ||
} else { | ||
// Otherwise send token to a known user | ||
console.log('registered authy id'); | ||
console.log('registered authy user found'); | ||
sendToken(); | ||
} | ||
|
||
|
@@ -28,7 +27,7 @@ let AuthyUser = { email: '[email protected]', cellphone: user.mobile, countryCode: | |
authy.request_sms(user.authyId, true, function(error, response) { //force : true | ||
if(error) errorCallback(error); | ||
else | ||
successCallback(response, user); | ||
successCallback(response, user.authyId); | ||
}); | ||
|
||
} | ||
|
@@ -37,7 +36,7 @@ let AuthyUser = { email: '[email protected]', cellphone: user.mobile, countryCode: | |
// Test a 2FA token | ||
auth.verifyAuthyToken = function(authyId, otp , cb) { | ||
|
||
authy.verify(179825188, otp, function(err, response) { | ||
authy.verify(authyId, otp, function(err, response) { | ||
cb(err, response); | ||
}); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>dashboard works!</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DashboardComponent } from './dashboard.component'; | ||
|
||
describe('DashboardComponent', () => { | ||
let component: DashboardComponent; | ||
let fixture: ComponentFixture<DashboardComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DashboardComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DashboardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-dashboard', | ||
templateUrl: './dashboard.component.html', | ||
styleUrls: ['./dashboard.component.css'] | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters