简体   繁体   中英

signIn with Devise from an API

I have a problem with the user authentication. I exposed a user API and the json output is like this:

[
    {
         id: 1,
         email: "khelif.ghassen@gmail.com",
         nom: "Ghassen",
         prenom: "Khelif",
         created_at: "2017-11-05T03:18:19.640Z",
         updated_at: "2017-11-05T03:18:19.644Z"
    }
]

I can't see the crypted password

for this moment I'm just showing up all users (I have just on user for this moment) and this is my class to return this JSON

`

module TESTAPP
  module V1
    class Users < Grape::API
      version 'v1', using: :path
      format :json
      prefix :api
      resource :users do
        desc "Return list of users"
  get do
    User.all
  end

  desc "Return an objet"
  params do
    requires :id, type: Integer, desc: "User id"
  end
  route_param :id do
    get do
      User.find(params[:id])
    end
  end
end

end
end
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM