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

Fix auth renewal #211

Merged
merged 3 commits into from
May 23, 2023
Merged

Fix auth renewal #211

merged 3 commits into from
May 23, 2023

Conversation

kulmann
Copy link
Member

@kulmann kulmann commented May 22, 2023

Fixes two things:

  1. adds 401 error handling -> user will be presented with the authenticate button again. Trying to authenticate and then replay the previously failed requests is unfortunately a bigger task - won't happen in this PR (and also not planned effort short term). Did this by adding a) a response interceptor on the axios instance (used for graph API) and b) auth error handling in the catch block of the loadFolder method (webdav).
  2. the filepicker initialization had a bug which made sense to solve here: if the user was initially authenticated the userLoaded event would always call updateBearerToken. If the user was initially unauthenticated the userLoaded event would always call initApp (which does a lot of things that are not needed on subsequent token renewals). Corrected the userLoaded event handler to call initApp if not in authorized state and then on subsequent token renewals call the updateBearerToken method instead.

@kulmann kulmann self-assigned this May 23, 2023
@kulmann kulmann marked this pull request as ready for review May 23, 2023 13:27
@kulmann kulmann requested a review from fschade as a code owner May 23, 2023 13:27
@kulmann kulmann merged commit e1ca28a into master May 23, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix-auth-renewal branch May 23, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants