Skip to content

Instantly share code, notes, and snippets.

View hotsoft-desenv4's full-sized avatar

Roger Del Nobre hotsoft-desenv4

View GitHub Profile
@sheharyarn
sheharyarn / api_controller.rb
Last active January 18, 2021 15:13
API Authentication with Devise in Rails
class API::BaseController < ApplicationController
def index
render json: { active: true }
end
def authenticate
if user = User.authenticate(request.headers['X-AUTH-TOKEN'])
sign_in(user, store: false)