Skip to content

Instantly share code, notes, and snippets.

@levinotik
Created March 22, 2012 16:15
Show Gist options
  • Save levinotik/2159264 to your computer and use it in GitHub Desktop.
Save levinotik/2159264 to your computer and use it in GitHub Desktop.
class SessionsController < Devise::SessionsController
def create
respond_to do |format|
format.html { super }
format.json {
warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new")
# render :status => 200, :json => { :error => "Success" }
render :status => :ok, :json => { :response => 'ok', :auth_token => User.authentication_token }
}
end
end
def destroy
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment