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

Force auth if refresh fails #5

Merged
merged 2 commits into from
Oct 7, 2021
Merged

Force auth if refresh fails #5

merged 2 commits into from
Oct 7, 2021

Conversation

erikdubbelboer
Copy link
Member

When a refresh fails we should try the normal auth flow again.

src/auth.js Outdated Show resolved Hide resolved
config = JSON.parse(readFileSync(configPath, 'ascii'))
} catch (e) {
// Ignore.
if (!force) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would split out a function fetchAuthFromP4d. It would allow expressing this more elegantly/explicitly, not relying on config === undefined in the check below. Rather, you could call it right away if force === false

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets keep this for a slightly bigger refactor.

@erikdubbelboer erikdubbelboer merged commit 90926e6 into make-public Oct 7, 2021
@erikdubbelboer erikdubbelboer deleted the auth-refresh branch October 7, 2021 12:23
erikdubbelboer added a commit that referenced this pull request Oct 21, 2021
Bring back #5 which was somehow
reverted after the typescript rewrite.
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.

3 participants