Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front end Auth checkup #463

Closed
MikeyManoguerra opened this issue Dec 11, 2020 · 7 comments · Fixed by #499
Closed

Front end Auth checkup #463

MikeyManoguerra opened this issue Dec 11, 2020 · 7 comments · Fixed by #499
Assignees
Labels
bug Something isn't working frontend

Comments

@MikeyManoguerra
Copy link
Collaborator

Last time I looked at this, I believe some of the values were undefined. I think we should reassess how we are using the tokens, and log out after inactivity?

If a user is using the app consistently over time, then we can use the access and refresh tokens. but if the user goes inactive, the should be definitively logged out

I'll update if the undefined part bears Fruit after an inquiry

@MikeyManoguerra
Copy link
Collaborator Author

Some updates. I think that part of this ticket #455 is related to an auth issue. It might be because I had the tab open for a really long time.

the /token/refresh route doesnt work some times, but when i looked at the cookies were many (20+) duplicates of the two cookies.

i think this has to do with when the cookies are reset, it sets for that specific path in the dom, which could be a number of paths in the application. thus cookies with duplicate keys, and then the timestamp is expired for the refresh token when the browser tab is open for more than a day.

I still think that we should also build a setTimeout to check for inactivity, but this is a brand new feature, whereas setting an explicit path should fix this bug.

The weirdest part is the partcipant search seems to the buggiest path, maybe bc of the query params idk...

@MikeyManoguerra
Copy link
Collaborator Author

Screen Shot 2020-12-12 at 12 03 28 AM

@MikeyManoguerra
Copy link
Collaborator Author

Screen Shot 2020-12-20 at 10 03 52 PM

verify fails, refresh goes fine, but then second verify made to endpoint without /api/ prepended...

Just adding notes here for context.

@mariekers mariekers added bug Something isn't working frontend labels Jan 20, 2021
@mariekers mariekers assigned mariekers and medy-io and unassigned mariekers Jan 20, 2021
@MikeyManoguerra
Copy link
Collaborator Author

I added this recently @crsmyz

@action setParticipantsList = data => {

@medy-io
Copy link
Collaborator

medy-io commented Jan 27, 2021

Got my local updated and working, currently checking on the initial token generation

@medy-io
Copy link
Collaborator

medy-io commented Jan 28, 2021

It

Screen Shot 2020-12-20 at 10 03 52 PM

verify fails, refresh goes fine, but then second verify made to endpoint without /api/ prepended...

Just adding notes here for context.

According to the code it looks like the verifyToken() is called in authEndpoints.js along with the refreshAuthLogic() inside of the refreshAuthLogic.js causing the dup call that fails.

@medy-io
Copy link
Collaborator

medy-io commented Jan 28, 2021

Line 12 in refreshAuthLogic.js

failedRequest.response.config.url === "/api/token/verify/"

The config.url doesn't necessarily matchup to the desired endpoint call preventing the token property from ever getting assigned in some situations.

@medy-io medy-io linked a pull request Feb 1, 2021 that will close this issue
@medy-io medy-io closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants