Skip to content

Commit

Permalink
fix mistake of session
Browse files Browse the repository at this point in the history
  • Loading branch information
nna774 committed Dec 12, 2024
1 parent 1279a4d commit 51035a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/rubysky/raw/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def upload_image(file:, mime_type:, alt: "")
private

def valid_access_jwt?
jwt = JWT.decode(@access_jwt, nil, false, algorithm: "RS256")
jwt = JWT.decode(@session.access_jwt, nil, false, algorithm: "RS256")
payload = jwt[0]
payload["exp"] > Time.now.to_i + 10
end
Expand All @@ -120,9 +120,8 @@ def refresh_if_needed
end

def refresh!(refresh_jwt: nil, pds: nil)
@refresh_jwt = refresh_jwt if refresh_jwt
@pds = pds if pds
res = send_post(pds: @pds, path: REFRESH_SESSION_PATH, auth: @refresh_jwt)
res = send_post(pds: @pds, path: REFRESH_SESSION_PATH, auth: refresh_jwt || @session.refresh_jwt)
ensure_success(res:, called_from: REFRESH_SESSION_PATH)

json = JSON.parse(res.body)
Expand Down

0 comments on commit 51035a6

Please sign in to comment.