Enabled Json Web Token authorisation on backend, and frontend #4
Reference in New Issue
Block a user
Delete Branch "login"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
jwt-authentication-for-wp-rest-api - is third party code, so it is not subjected to this code review
Smoke test:
Deploy app with docker (view README)
Expected : 1) Login request to backend will return 200 and token
2) App will try to open dashboard page and display a bunch of errors (other endpoints need to be fetched too in order to display this page prorperly)
changed the description
changed the description
Please use
${API_SERVER}for this url and not localhost.But since it seems there my be bug in docker .env file regarding
API_URLandREACT_APP_DEV_URLvariables. (REACT_APP_DEV_URLhas valuehttp://localhost:8081/$%7BAPI_URL%7Dfor local enviroment andhttp://next.wiaas.saburly.com/$%7BAPI_URL%7Dfor test env) fix should also be done there.Also we could update
config.jsto removeAPI_VERSIONfromAPI_SERVERsince it is of no use for us. Then we can use${API_SERVER}here.The same for
http://localhost//wp-json/jwt-auth/v1/token/validateregarding usage of ${API_SERVER}.Seems like
response.data.data.status === 200is the path here? The code inside never executed for me until this change.Only after activating, updates to .htaccess and wp-config.php as noted in plugin page (https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/) I could use the plugin on frontend.
Can we have the changes we need in .htaccess and wp-config.php commited (since automatic deployment will start after merge)?
@akrdzic Thx for review, next time there is no need for you to go trough the whole thing and get it to work , if the smoke test fails. Just say it failed and where, and it is up to that person that submitted the code to find out. :)
The reason why everything worked for me locally is cause docker container frontend as you saw did point out to localhost (with port 80 that is my development copy of wordpress, that had all those thnigs like httaccess setup.) and not the wordpress in container. I did change the localhost to
{API_SERVER}but forgot to save :D (lame excuse, it is cause I switch between two editors, one that autosaves, and one that doesn't )Aniways I will fix everything, and rewrite smoke test
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
added 1 commit
5c07b371- Fixed docker env bugs, and issues from PRCompare with previous version
changed the description
merged
mentioned in commit
63cce6100c