Module: BetterAuth::Plugins::OAuthProvider
- Defined in:
- lib/better_auth/plugins/oauth_provider.rb
Class Method Summary collapse
Class Method Details
.validate_issuer_url(value) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/better_auth/plugins/oauth_provider.rb', line 11 def validate_issuer_url(value) uri = URI.parse(value.to_s) uri.query = nil uri.fragment = nil if uri.scheme == "http" && !["localhost", "127.0.0.1", "::1"].include?(uri.hostname || uri.host) uri.scheme = "https" end uri.to_s.sub(%r{/+\z}, "") rescue URI::InvalidURIError value.to_s.split(/[?#]/).first.sub(%r{/+\z}, "") end |