Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create
- self.resource = warden.authenticate!(auth_options)
- set_flash_message!(:notice, :signed_in)
- sign_in(resource_name, resource)
- yield resource if block_given?
- respond_to do |format|
- format.json do
- if resource.errors.empty?
- render json: resource, status: :ok
- else
- render json: { status: :unauthorized }
- end
- end
- format.html do
- super
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement