Skip to content

Instantly share code, notes, and snippets.

@ChrisHodges
Created February 26, 2024 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisHodges/49370a69701c238d8962bb54e0829c61 to your computer and use it in GitHub Desktop.
Save ChrisHodges/49370a69701c238d8962bb54e0829c61 to your computer and use it in GitHub Desktop.

Safeguard ME Coding Exercise - CV Uploader via a Web Portal

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:

  1. 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: 'some@email.com', 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'}
  2. 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
  3. 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
  4. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment