Sha256: 1c02af5b6714c3024b11d2f34bfe164d98a229c6cd4926ddd5f24b2d2c7b7b28
Contents?: true
Size: 669 Bytes
Versions: 14
Compression:
Stored size: 669 Bytes
Contents
module DeviseTokenAuth class TokenValidationsController < DeviseTokenAuth::ApplicationController skip_before_filter :assert_is_devise_resource!, :only => [:validate_token] before_filter :set_user_by_token, :only => [:validate_token] def validate_token # @resource will have been set by set_user_token concern if @resource render json: { success: true, data: @resource.as_json(except: [ :tokens, :created_at, :updated_at ]) } else render json: { success: false, errors: ["Invalid login credentials"] }, status: 401 end end end end
Version data entries
14 entries across 14 versions & 2 rubygems