Sha256: 4db2ca7b89e8952a4c5cfff3d024da16b6c6c9428a8c36782f6ee7fa61af5791
Contents?: true
Size: 510 Bytes
Versions: 11
Compression:
Stored size: 510 Bytes
Contents
require 'json' module RailsSso class FetchUser def initialize(client) @client = client end def call response = client.get(RailsSso.provider_profile_path) case response.status when 200 begin JSON.parse(response.body) rescue response.body end when 401 raise ResponseError.new(:unauthenticated) else raise ResponseError.new(:unknown) end end private attr_reader :client end end
Version data entries
11 entries across 11 versions & 1 rubygems