Skip to content

[BUG] Empty .jwks file causes sign-in errors #582

@aristizabal95

Description

@aristizabal95

Describe the bug
In some strange edge cases, the .jwks file that resides in ~/.medperf_config/.tokens can end up empty. When that happens, Authentication fails, as medperf tries to read this file as a JSON object and can't figure out how to parse empty files.

To Reproduce

  1. Create an empty .jwks file in ~/.medperf_config/.tokens. Rename the previos one if needed
  2. Sign out of medperf.
  3. Try to sign back in. A JSONDecodeError will be raised.

Expected behavior
While the expected behavior should be to completely avoid generating empty .jwks file, a good additional behavior is to try to read the file and if it fails remove the corrupted one an regenerate it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions