Skip to content

Commit 286eb08

Browse files
committed
Fix
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 6926f21 commit 286eb08

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

enterprise/server/include/sourcemeta/one/enterprise_server_action_auth_callback_v1.h

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ class ActionAuthCallback_v1 : public sourcemeta::one::RouterAction {
315315
this->remember_renewal(response, policy_name, scope, secure);
316316
// The single-use transaction has served its purpose, so it is expired
317317
// alongside minting the session
318-
this->expire_transaction(response, scope, secure);
318+
this->expire(response, sourcemeta::one::Authentication::TRANSACTION_COOKIE,
319+
scope, secure);
319320
response.write_header("Location", destination);
320321
response.write_header("Cache-Control", "no-store");
321322
sourcemeta::one::send_response(sourcemeta::core::HTTP_STATUS_SEE_OTHER,
@@ -495,7 +496,8 @@ class ActionAuthCallback_v1 : public sourcemeta::one::RouterAction {
495496
response.write_status(sourcemeta::core::HTTP_STATUS_SEE_OTHER);
496497
this->expire(response, sourcemeta::one::Authentication::RENEWAL_COOKIE,
497498
scope, secure);
498-
this->expire_transaction(response, scope, secure);
499+
this->expire(response, sourcemeta::one::Authentication::TRANSACTION_COOKIE,
500+
scope, secure);
499501
response.write_header("Location", destination);
500502
response.write_header("Cache-Control", "no-store");
501503
sourcemeta::one::send_response(sourcemeta::core::HTTP_STATUS_SEE_OTHER,
@@ -518,22 +520,6 @@ class ActionAuthCallback_v1 : public sourcemeta::one::RouterAction {
518520
}
519521
}
520522

521-
auto expire_transaction(sourcemeta::one::HTTPResponse &response,
522-
const std::string_view scope, const bool secure) const
523-
-> void {
524-
const auto cookie{sourcemeta::core::http_serialize_cookie(
525-
{.name = sourcemeta::one::Authentication::TRANSACTION_COOKIE,
526-
.value = "",
527-
.path = scope,
528-
.max_age = std::chrono::seconds{0},
529-
.http_only = true,
530-
.secure = secure,
531-
.same_site = sourcemeta::core::HTTPCookieSameSite::Lax})};
532-
if (cookie.has_value()) {
533-
response.write_header("Set-Cookie", cookie.value());
534-
}
535-
}
536-
537523
// RFC 6749 Section 2.3.1 has every server accept the client secret in an
538524
// authorization header, and asks that carrying it in the request body be
539525
// limited to clients that cannot send one. A body is the part of a request

0 commit comments

Comments
 (0)