The purpose of this exercise is to create a React or Expo app which allows a user to log into an API then upload an picture of their CV via a web portal.
The user journey should follow these steps:
- The user should log in via a login form using an email and password
- This should be a basic form with email and password fields. You can use the React Native core library or a forms package of your choice
- The form should send a POST request to the following URL:
https://safeguard-me-coding-exercise.azurewebsites.net/api/Login
with a JSON body of the form:
{email: '[email protected]', password:'any_password'}
- As this is a coding exercise you can send any username and password you like.
- You will receive a response of the form:
{accessToken: 'A_VERY_LONG_JWT_ACCESS_TOKEN_WILL_BE_RETURNED_HERE'}
- The app should then request make a GET request to the endpoint https://safeguard-me-coding-exercise.azurewebsites.net/api/PortalUrl
- This is a protected endpoint so you'll need to add an Authorization header to your request of the form:
Authorization: Bearer THE_JWT_ACCCESS_TOKEN_YOU_RECEIVED_IN_STEP_1
- This endpoint returns a plain text string which is a URL for a web portal where the user can upload a document
- This is a protected endpoint so you'll need to add an Authorization header to your request of the form:
- The app should then display the Portal URL you obtained from step 2 in a webview.
- The webview requires that the user uploads a document so you'll need to consider how to obtain a permission from user for file access
- When the user successfully uploads a document they'll be redirected to the URL https://safeguard-me-coding-exercise.azurewebsites.net/api/PortalSuccess
- You'll need to detect this change in URL in your webview and display a success message instead of the webview