Override spree_oauth/token api method in spree 4.4
abhishekpanda626 opened this issue · 0 comments
I'm using the Spree storefront API with Spree 4.4.0 for the e-commerce app.
/spree_oauth/token
The above routes only generate access-tokens by getting the email & password. I want to override the method I couldn't find in the repo. I want to add some extra validation with email and password to generate an access token and send a new flag i.e restricted: true/false along with access token.
I did find the route it's on index.yml but still not sure how to override it from there.
Is there any alternative instead of overriding the API method that would be quite useful as I'm using next for frontend and want to check the flag restricted there to show a custom alert to user instead of invalid email/password