Skip to content

Commit

Permalink
Merge pull request #324 from mrememisaac/replicate-physician-registra…
Browse files Browse the repository at this point in the history
…tion-page

Replicate physician registration page closes #88
  • Loading branch information
sethuraj authored Jun 21, 2020
2 parents 19088e4 + af15682 commit 45455f6
Show file tree
Hide file tree
Showing 7 changed files with 492 additions and 24 deletions.
38 changes: 22 additions & 16 deletions api/routes/userList.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,29 @@ class UserList{
}

async validateUser (req, res) {
const jwtToken = req.body;
const user = parseToken(jwtToken.jwt);
const verifiedUser = await this.userDao.getUser(user.email);
user.profilestatus = "level 0"; //initializing the access
if (verifiedUser !== undefined)
{
user.id = verifiedUser.id;
user.npiidentifier = verifiedUser.npiidentifier;
user.role = verifiedUser.role;
user.country = verifiedUser.country;
user.profilelink = verifiedUser.profilelink;
user.anonymous = verifiedUser.anonymous;
user.profilestatus = verifiedUser.profilestatus;
user.email = verifiedUser.email;
await this.userDao.updatesignintime(user);
try{
const jwtToken = req.body;
const user = parseToken(jwtToken.jwt);
const verifiedUser = await this.userDao.getUser(user.email);
user.profilestatus = "level 0"; //initializing the access
if (verifiedUser !== undefined)
{
user.id = verifiedUser.id;
user.npiidentifier = verifiedUser.npiidentifier;
user.role = verifiedUser.role;
user.country = verifiedUser.country;
user.profilelink = verifiedUser.profilelink;
user.anonymous = verifiedUser.anonymous;
user.profilestatus = verifiedUser.profilestatus;
user.email = verifiedUser.email;
await this.userDao.updatesignintime(user);
}
res.send(user);
}catch(error){
//TODO: log error
res.status(403).send("Could not verify user");
return;
}
res.send(user);
}

async getUser (email) {
Expand Down
5 changes: 5 additions & 0 deletions client/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": false
}
Loading

0 comments on commit 45455f6

Please sign in to comment.