Skip to content

Commit

Permalink
Now supports family view
Browse files Browse the repository at this point in the history
  • Loading branch information
timvandam authored Jul 9, 2018
1 parent 6a436a1 commit f923c08
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/inquirer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ module.exports = a = {
message: 'Please enter your authentication code',
validate
}]),
askFamilyView: () =>
inquirer.prompt([{
name: 'pin',
type: 'password',
message: 'Please provide your family view pin',
validate: e => e && !isNaN(e) && e.length === 4
}]),
askRestrictions: () =>
inquirer.prompt([{
name: 'tradableOnly',
Expand Down
19 changes: 19 additions & 0 deletions lib/logon.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,24 @@ module.exports = {

back({ manager, community });
});
}),
checkFamilyView: community => new Promise(back => {
community.loggedIn((error, loggedIn, familyView) => {
if (error)
back(['ERROR']);

if (!loggedIn)
back(['NOTLOGGEDIN']);

back(familyView);
});
}),
parentalUnlock: (community, pin) => new Promise(back => {
community.parentalUnlock(pin , error => {
if (error)
back(['ERROR']);

back();
});
})
};

0 comments on commit f923c08

Please sign in to comment.