mirror of
https://github.com/wahyd4/Libr.git
synced 2026-08-23 19:57:23 +10:00
18 lines
358 B
Ruby
18 lines
358 B
Ruby
class Api::V1::SessionsController < Devise::SessionsController
|
|
|
|
def create
|
|
warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#failure")
|
|
render :json => {:success => true}
|
|
end
|
|
|
|
|
|
def destroy
|
|
sign_out(resource_name)
|
|
end
|
|
|
|
def failure
|
|
render :json => {:success => false, :errors => ["Login Failed"]}
|
|
end
|
|
|
|
end
|