-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#17] [API] As a User, I can sign up and sign in/out with a username and password #35
Conversation
@malparty Last few minor comments, very close to approving it. :) |
include ErrorHandlerConcern | ||
|
||
# Overridden from doorkeeper as the doorkeeper revoke action does not return response according to json-api spec | ||
def revoke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused methods (api::v1::tokenscontroller#revoke) |
# The authorization server responds with HTTP status code 200 if the client | ||
# submitted an invalid token or the token has been revoked successfully. | ||
if token.blank? | ||
render json: token_revoke_response, status: :ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calls 'render json: token_revoke_response, status: :ok' 2 times |
# of the error by the authorization server as described below. | ||
elsif authorized? | ||
revoke_token | ||
render json: token_revoke_response, status: :ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calls 'render json: token_revoke_response, status: :ok' 2 times |
} | ||
end | ||
|
||
def token_revoke_response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't depend on instance state (maybe move it to another class?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
@junan, "Looks Good To Me" or "Let's Go To Merge"? 😄 |
#17 [API] As a User, I can sign up and sign in/out with a username and password
What happened
Adding OAuth2 API to sign_in, sign_out and sign_up
Insight
Routes (all POST)
/api/v1/users
=>Api::V1::UsersController/create
/api/v1/oauth/token
=>Doorkeeper::TokensController/create
/api/v1/oauth/revoke
=>Doorkeeper::TokensController/revoke
/oauth/applications/
=>Doorkeeper::ApplicationsController/index
Proof Of Work
All 3 examples are available in the postman documentation (link available in the GitHub Wiki too)
Following @junan feedback, we now have Doorkeeper UI to manage apps: