Sha256: 5c82da5d3e689022e1d8e696b34c8fb854e9e33a3294397cefda7e492cb27b30
Contents?: true
Size: 721 Bytes
Versions: 11
Compression:
Stored size: 721 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
11 entries across 11 versions & 1 rubygems