Sha256: e9a9f5fcc2d9a6b64762c6d96e98b6faf38c9d43a35552f5987d2a02e3cd4ab9
Contents?: true
Size: 657 Bytes
Versions: 11
Compression:
Stored size: 657 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 # @user will have been set by set_user_token concern if @user render json: { success: true, data: @user.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
11 entries across 11 versions & 1 rubygems