我使用Grape来实现我的应用的API服务。但是如何在Grape中调用设计方法sign_in
?
答案 0 :(得分:0)
您需要编写将发布user_name&的API。密码并在API响应中返回用户toke
作为
http://localhost:3000/api/v0/auth/sign_up
POST参数
user[email]=p@p.com
user[password]=p123
在AuthController中
def sign_up
#create user and user token
render json: { token: <generated user token>}
end
你需要为sign_in编写类似的api 使用此标记进行后续API调用以授权用户