Sha256: a254d7ab835cb4f34681e7fab3648c140b16adc7335bcf28964acab5fcf50d03
Contents?: true
Size: 494 Bytes
Versions: 13
Compression:
Stored size: 494 Bytes
Contents
module Shieldify module Controllers module Helpers def current_user warden.user end def user_signed_in? !!current_user end def authenticate_user! unless user_signed_in? respond_to_unauthorized end end private def warden request.env['warden'] end def respond_to_unauthorized render json: { error: 'No autorizado' }, status: :unauthorized end end end end
Version data entries
13 entries across 13 versions & 1 rubygems