0
votes

I have a rails app with grape integrated, i tried to integrate devise token auth, and i was able to sign up/sign in with the urls mentioned in the pdf.

But i do face a problem with grape i could nt use methods like user_signed_in? or authenticate_user! inside grape api, included concerns in user model or controller doesnt work here.

i have tried to integrate these methods inside the grape by calling some files like

require  '........'

Is there any way to require files and call these methods inside grape api.

1

1 Answers

0
votes

Have you resolved this issue? There is a specific gem that uses devise_token_auth that works with grape. https://github.com/mcordell/grape_devise_token_auth. Setting that up should help solve your issue.

GrapeDeviseTokenAuth gem is a compatibility layer between devise_token_auth and grape. It is useful when mounting a grape API in a rails application where devise (or devise_token_auth + devise) is already present. It is reliant on devise_token_auth and devise, therefore it is not suitable for grape where these are not present. If you are looking for a pure grape solution, you should check out grape_token_auth.