/asksteve

React Native GitHub Search App: AskSteve code challenge

Primary LanguageJavaScript

GitSearch

Setup

Auth0:
https://auth0.com/docs/quickstart/native/react-native/00-login
https://auth0.com/docs/applications/application-grant-types#how-to-edit-the-client-grant_types-property

react-native-auth0
https://github.com/auth0/react-native-auth0

Browser vs Native login:

https://auth0.com/docs/design/browser-based-vs-native-experience-on-mobile

If your platform supports it, you should use a browser-based login flow where your application presents an in-application (embedded) browser for login and signup. Using an in-application browser gives your application the benefits of browser-based authentication, such as shared authentication state and security context, without disrupting the user experience by switching applications.

.env

AUTH0_DOMAIN=enter-your-auth0-domain-here
AUTH0_CLIENT_ID=enter-your-auth0-client_id-here

Issues

  • Auth0 web login: will not fully logout session, but you can force re-open the login screen
  • GitHub app login: not working, getting wrong email / password error, ? explore Octokit GitHub REST API
  • With some repos, searching for commits returns empty results, or only a few commits, ? API limitation
  • logout not working android, issue with handling deep links on android

ToDo

  • refactor + optimise code
  • finish testing with Jest & react-testing-library

Testing - amend Jest preprocessor file for RN 0.57.5

  • FYI, the react-native/jest/prepprocessor.js needs to be adjusted, set inlineRequires to false. Otherwise you will get the following error when working with class components and arrow functions:

TypeError: Cannot read property 'default' of undefined

Screenshots

screenshot1 screenshot1a screenshot1b screenshot2 screenshot3 screenshot4