Skip to content

Instantly share code, notes, and snippets.

View marcelo-soto's full-sized avatar

Marcelo Soto marcelo-soto

  • Santiago, Chile
View GitHub Profile
@gonzalo-bulnes
gonzalo-bulnes / sessions_controller.rb
Last active August 24, 2017 09:41
A SimpleTokenAuthentication-compatible JSON version of Devise::SessionsController. (UPDATE: For a discussion about this gist and a better version of it, please see https://github.com/gonzalo-bulnes/simple_token_authentication/issues/48#issuecomment-42133939)
# app/controllers/sessions_controller.rb
class SessionsController < Devise::SessionsController
# This controller provides a JSON version of the Devise::SessionsController and
# is compatible with the use of SimpleTokenAuthentication.
# See https://github.com/gonzalo-bulnes/simple_token_authentication/issues/27
def create
# Fetch params