question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting password via /setpassword signs in user. Does not generate re-authentication credentials.

See original GitHub issue

If you haven’t already, check out our contributing guidelines for onboarding!


view the job on Upwork here.

Platform - version:
Current

Problem

It doesn’t seem like we are generating re-authentication credentials when a user hits https://expensify.cash/setpassword/[validateCode].

Why is this important?

I think anyone setting a password will be logged out when their authToken expires. And ideally they won’t be logged out at all once a password is set.

Solution

Generalize the logic here into a private action that can be used in the signIn() and setPassword() flows.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
marcaaroncommented, Feb 17, 2021

Plan sounds good. We can reproduce an authToken expiring by modifying the localStorage key session and deleting some characters from session.authToken - tapping on a new chat or trying to take any API action should in this case not log you out but refresh the token instead.

https://user-images.githubusercontent.com/32969087/108240312-d13e9900-70ee-11eb-8125-abd62723111d.mp4

1reaction
anthony-hullcommented, Feb 16, 2021

For this issue I would refactor the functionality into a new function in the Session.js action file and call that from within the signIn and setPassword functions, making it re-usable and keeping the code DRY. This is to all setPassword to set up the re-authentication credentials for when the token expires without reproducing the code from the signIn action.

I would first try to re-produce the “authToken expiration after re-setting” edge case. I would then call then confirm the desired refreshing of auth tokens take place after the change.

How long lived are the tokens? Do you have any advice on how to re-produce this edge case on demand? Otherwise I would look at a way to force this to happen to speed the feedback loop up if the token lives longer than a few minutes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set-ADAccountPassword (ActiveDirectory) - Microsoft Learn
This command prompts the user for a new password that is stored in a temporary variable named $NewPassword, then uses it to reset...
Read more >
Configure passwords for automatically created user accounts
When a user first accesses the instance with their new account, they must enter their user name and click on the Forgot Password?...
Read more >
Change Users' Passwords - Auth0
This topic describes different ways to reset the password for a user in your database. You can change passwords for users in your...
Read more >
Managing passwords for IAM users - AWS Documentation
Use AWS CLI or AWS API commands to create, change, or delete the password for an IAM user in your AWS account.
Read more >
How can I save username and password in Git? - Stack Overflow
Attention: This method saves the credentials in plaintext on your PC's disk. Everyone on your computer can access it, e.g. malicious NPM modules....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found