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

Fail when execute atob() #4

Closed
Kunniii opened this issue May 17, 2023 · 2 comments
Closed

Fail when execute atob() #4

Kunniii opened this issue May 17, 2023 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@Kunniii
Copy link
Owner

Kunniii commented May 17, 2023

Need more info...

@Kunniii Kunniii added bug Something isn't working question Further information is requested labels May 17, 2023
@Kunniii Kunniii self-assigned this May 17, 2023
@Kunniii
Copy link
Owner Author

Kunniii commented May 18, 2023

For some devices that failed when executing atob(), even though they can launch the extension, they can only do grade_group(). When trying grade_indie() there is no output, the error from the console shows something like it's a problem with Arrays when retrieving student info from API.

@Kunniii
Copy link
Owner Author

Kunniii commented May 18, 2023

The problem is that the Base64 in JWT token is being compressed, which means there is no padding on the encoded string. That will cause error when trying to decode it using atob().

Grading individuals require an email to check the group that the user is in. So, when atob() failed, there is no email to check, causing the function fails.

Resolve that by adding a function named addPaddingToBase64() and use it to add padding before converting it to a string.

@Kunniii Kunniii changed the title Unable to grade teammates for some reasons. Fail when execute atob() May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant