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
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/better_auth/plugins/oauth_provider.rb', line 8 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"].include?(uri.host) uri.scheme = "https" end uri.to_s.sub(%r{/+\z}, "") rescue URI::InvalidURIError value.to_s.split(/[?#]/).first.sub(%r{/+\z}, "") end |