Skip to content

Commit

Permalink
fix: auth and client formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessa-passage committed Nov 6, 2024
1 parent 7399cd7 commit fac04f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,3 @@ You can check for the gem here:
```
gem list -r passage
```

```
```
4 changes: 1 addition & 3 deletions lib/passageidentity/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def fetch_jwks()
if @@app_cache[@app_id]
@jwks, @auth_origin = @@app_cache[@app_id]
else
app = fetch_app
auth_gw_connection =
Faraday.new(url: "https://auth.passage.id") do |f|
f.request :json
Expand Down Expand Up @@ -80,7 +79,6 @@ def authenticate_request(request)
else
raise PassageError.new(message: "no authentication token")
end
nil
end

def validate_jwt(token)
Expand Down Expand Up @@ -131,7 +129,7 @@ def authenticate_token(token)
def revoke_user_refresh_tokens(user_id)
begin
client = OpenapiClient::TokensApi.new
response = client.revoke_user_refresh_tokens(@app_id, user_id)
client.revoke_user_refresh_tokens(@app_id, user_id)
return true
rescue Faraday::Error => e
raise PassageError.new(
Expand Down
3 changes: 2 additions & 1 deletion lib/passageidentity/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ def create_magic_link(
"magic_link_path"
] = magic_link_path unless magic_link_path.empty?
magic_link_req["redirect_url"] = redirect_url unless redirect_url.empty?
magic_link_req["language"] = language
magic_link_req["ttl"] = ttl unless ttl == 0
magic_link_req["type"] = type

begin
gemspec = File.join(__dir__, "../../passageidentity.gemspec")
spec = Gem::Specification.load(gemspec)
Gem::Specification.load(gemspec)
header_params = { "Passage-Version" => "passage-ruby #{Passage::VERSION}" }
header_params["Authorization"] = "Bearer #{@api_key}" if @api_key != ""

Expand Down

0 comments on commit fac04f4

Please sign in to comment.