Skip to content

Add omniauth

Anthony Shull requested to merge as/feat/863/omniauth into develop

I created a serviceable concern and made spaces serviceable. In order to test, run rails db:reset. You can check that one service was created with seeds: %> Service.first. Note the token. Visit http://localhost:3001/users/auth/eventbrite?user_id=1&serviceable_type=space&serviceable_id=1. Log in to Eventbrite and give JOGL permission. You will be redirected back to '/'. We can obviously change that. Again check the first service and you will see that the token has been updated. One important thing to note is that we are not verifying that the user is in fact user 1 or that they have access to serviceable object.

I also added devise-jwt. To test, run rails db:reset. Note the email and password of the created user. Send a POST request to localhost:3001/users/login with the email and password in a JSON object. You will see a header Authorization: ... and note that the old authorization headers are no longer present. You can take that header and add it as a request header in order to make a request. E.g., PATCH localhost:3001/api/feeds/2 with {"allowPostingToAll": false}. Remove the header and you will get an unauthorized response.

Closes https://gitlab.com/JOGL/JOGL/-/issues/863

Edited by Anthony Shull

Merge request reports