develop-me / bagajob

Job Hunting Management App built by Develop Me students for Develop Me students.
https://bagajob.developme.space
GNU Affero General Public License v3.0
1 stars 2 forks source link

Add single job - user ID is undefined #50

Closed kierancott closed 4 years ago

kierancott commented 4 years ago

Issue:

Upon adding a single job (POST api/user/user_id/jobs), the API returns 401 unauthorised. This is because the user_id in the request - and thus also in the Authorisation header - is undefined.

Screenshot 2020-09-18 at 18 03 30

Action:

Correctly retrieve user_id from state to be used in API request.

kierancott commented 4 years ago

Commit https://github.com/develop-me/bagajob/pull/42/commits/ee491d805cecd146b292fd2ccf8327c06a1dfc17

Update:

user_id is now used correctly in the URL:

Screenshot 2020-09-18 at 23 57 10

Todo:

Bearer token is not being correctly generated from user_id

kierancott commented 4 years ago

Resolved

Commit https://github.com/develop-me/bagajob/pull/42/commits/e09682b977347eefbc961bd925a35025ee07e000

Action:

Bearer token has been added to the header of the request.

Result:

422 - Unprocessable Entity : API is no longer returning an authorisation error. Bearer token correctly used in header.

Screenshot 2020-09-19 at 00 28 33

kierancott commented 4 years ago

Issue closed in error - implies no action was taken.

Issue was resolved on user_account_page_and_auth_functionality branch by commit https://github.com/develop-me/bagajob/commit/e09682b977347eefbc961bd925a35025ee07e000.

However, these changes have yet to be merged, and will be resolved by PR https://github.com/develop-me/bagajob/pull/42.

Issue will remain open until closed by merge of PR https://github.com/develop-me/bagajob/pull/42 into development.