Sha256: 1d58f3a94c2945f5cca16a108516845f550748664fadb4a1bef79429286c0339
Contents?: true
Size: 720 Bytes
Versions: 3
Compression:
Stored size: 720 Bytes
Contents
require 'jwt' module ForestLiana class ApplicationController < ActionController::Base before_filter :authenticate_user_from_jwt def serialize_model(model, options = {}) options[:is_collection] = false JSONAPI::Serializer.serialize(model, options) end def serialize_models(models, options = {}) options[:is_collection] = true json = JSONAPI::Serializer.serialize(models, options) if options[:count] json[:meta] = {} unless json[:meta] json[:meta][:count] = options[:count] end json end def authenticate_user_from_jwt JWT.decode request.headers[:Authorization].split[1], ForestLiana.jwt_signing_key end end end
Version data entries
3 entries across 3 versions & 1 rubygems