Skip to content

Commit

Permalink
Remove error log
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAsjes committed Aug 29, 2024
1 parent 1bca00c commit 5a0d354
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def with_auth(request, response, client_id, cookie_password)
redirect "/login" if !result[:authenticated]
response.set_cookie("wos_session", value: result[:sealed_session], httponly: true, secure: true, samesite: "lax")
redirect request.url
rescue StandardError => e
rescue e
puts e
response.delete_cookie("wos_session")
redirect "/login"
Expand All @@ -51,7 +51,6 @@ def with_auth(request, response, client_id, cookie_password)
end

get "/login" do
puts "wat #{ENV['WORKOS_REDIRECT_URI']}"
authorization_url = WorkOS::UserManagement.authorization_url(
provider: "authkit",
client_id: client_id,
Expand All @@ -68,13 +67,16 @@ def with_auth(request, response, client_id, cookie_password)
auth_response = WorkOS::UserManagement.authenticate_with_code(
client_id: client_id,
code: code,
session: { :seal_session => true, :cookie_password => cookie_password }
session: {
seal_session: true,
cookie_password: cookie_password
}
)

# store the session in a cookie
response.set_cookie("wos_session", value: auth_response.sealed_session, httponly: true, secure: true, samesite: "lax")
redirect "/"
rescue StandardError => e
rescue e
puts e
redirect "/login"
end
Expand Down

0 comments on commit 5a0d354

Please sign in to comment.