Skip to content

Commit

Permalink
Merge pull request #138 from buggregator/hotfix/sticky-auth-session
Browse files Browse the repository at this point in the history
Fixes problem with stuck auth session
  • Loading branch information
butschster authored Apr 17, 2024
2 parents 65e8d56 + 2c244d6 commit fed0a63
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/src/Application/Bootloader/AuthBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@

final class AuthBootloader extends Bootloader
{
public function defineSingletons(): array
public function defineBindings(): array
{
return [
Auth0::class => static fn(SdkConfiguration $config, SessionScope $session) => new Auth0(
$config->setTransientStorage(new SessionStore($session)),
),

SdkConfiguration::class => static fn(EnvironmentInterface $env) => new SdkConfiguration(
strategy: $env->get('AUTH_STRATEGY', SdkConfiguration::STRATEGY_REGULAR),
domain: $env->get('AUTH_PROVIDER_URL'),
Expand All @@ -34,11 +38,12 @@ public function defineSingletons(): array
scope: \explode(',', $env->get('AUTH_SCOPES', 'openid,profile,email')),
cookieSecret: $env->get('AUTH_COOKIE_SECRET', $env->get('ENCRYPTER_KEY') ?? 'secret'),
),
];
}

Auth0::class => static fn(SdkConfiguration $config, SessionScope $session) => new Auth0(
$config->setTransientStorage(new SessionStore($session)),
),

public function defineSingletons(): array
{
return [
AuthSettings::class => static fn(
EnvironmentInterface $env,
UriFactoryInterface $factory,
Expand Down

0 comments on commit fed0a63

Please sign in to comment.