Sha256: b471e64772ab7e54d927b9947709e7c1f921f5118fa00b1d1c150662d52921fe

Contents?: true

Size: 909 Bytes

Versions: 1

Compression:

Stored size: 909 Bytes

Contents

# frozen_string_literal: true

require 'jwt'

module Minty
  module Api
    module AuthenticationEndpoints
      def sign_in_url(client_id: @client_id, client_secret: @client_secret, organization: @organization)
        response = request_with_retry(:get, '/sign_in_url')
        response['redirect_url']
      end

      def sign_up_url(client_id: @client_id, client_secret: @client_secret, organization: @organization)
        response = request_with_retry(:get, '/sign_up_url')
        response['redirect_url']
      end

      def forgot_password_url(client_id: @client_id, client_secret: @client_secret, organization: @organization)
        response = request_with_retry(:get, '/forgot_password_url')
        response['redirect_url']
      end

      private

      def to_query(hash)
        hash.map { |k, v| "#{k}=#{CGI.escape(v)}" unless v.nil? }.reject(&:nil?).join('&')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minty-1.0.0 lib/minty/api/authentication_endpoints.rb