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

Don't allow using passager if Crypto API is not present #50

Open
oegea opened this issue Sep 29, 2022 · 2 comments
Open

Don't allow using passager if Crypto API is not present #50

oegea opened this issue Sep 29, 2022 · 2 comments
Labels
bug Something isn't working hacktoberfest Ideal issues to be completed during the hacktoberfest event

Comments

@oegea
Copy link
Owner

oegea commented Sep 29, 2022

Bug issue

🐛 Describe the bug

When Passager is accessed from a browser which not supports the crypto web API, the app will load with apparent success, but will crash once a crypto operation is requested (i.e. during the login process).

🧑🏽‍🔧 To Reproduce

  1. Install a web browser which doesn't support the crypto web api.
  2. Access Passager, and try to login.
  3. During the login process, the app will become unresponsive, without offering any visual message error.

✅ Expected behavior

The app should display a message when used browser does not support the cypto API, not allowing to perform any kind of operation, and encouraging the user to user an updated browser.

📸 Screenshots

Does not apply.

💻 System information

Any old web browser which does not support the Crypto Web API.

💬 Additional context

Crypto Web API compatibility can be found here: https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API#browser_compatibility

@oegea oegea added bug Something isn't working hacktoberfest Ideal issues to be completed during the hacktoberfest event labels Sep 29, 2022
@VarunGitGood
Copy link
Contributor

can we use conditional rendering for this
if the user does not have it itll prompt the user and if he/she does then the login page will load

@oegea
Copy link
Owner Author

oegea commented Oct 1, 2022

Yep. The idea is to create a new component which will return its children if the crypto API is available and if not, will return an error message saying that current browser is not supported.

Thanks to this kind of architecture, it's possible then to wrap the login page as children of that component.

Example:

const NotSupportedBrowserChecker = ({children}) => {
   if (isBrowserSupported() === false){ // TODO: Create a function to detect if browser is supported
      // TODO: Display a message indicating that browser is not supported
      return;
   }
   
   return children;
}

And then it is possible to wrap the Login page within NotSupportedBrowserChecker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest Ideal issues to be completed during the hacktoberfest event
Projects
None yet
Development

No branches or pull requests

2 participants