Skip to content

Commit

Permalink
Merge pull request #131 from buggregator/hotfix/auth
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
butschster authored Apr 11, 2024
2 parents 8824b61 + f1751b6 commit d533cba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(
) {
}

#[Route(route: 'smtp/<uuid>/attachment/<id>', name: 'smtp.attachment.download', group: 'api')]
#[Route(route: 'smtp/<uuid>/attachment/<id>', name: 'smtp.attachment.download', group: 'api_guest')]
public function __invoke(
QueryBusInterface $bus,
ResponseWrapper $responseWrapper,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Application/Auth/JWTTokenStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function create(array $payload, \DateTimeInterface $expiresAt = null): To
];

return new Token(
JWT::encode($token,$this->secret,$this->algorithm),
JWT::encode($token, $this->secret, $this->algorithm),
$token,
$payload,
$issuedAt,
Expand Down
5 changes: 4 additions & 1 deletion app/src/Application/Bootloader/RoutesBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ protected function middlewareGroups(): array
'web' => [
'middleware:auth',
],
'web_guest' => [
'middleware:auth',
],
'api' => [
'middleware:auth',
],
Expand Down Expand Up @@ -102,7 +105,7 @@ protected function defineRoutes(RoutingConfigurator $routes): void
->action(DocumentationController::class, 'yaml');

$routes->default('/<path:.*>')
->group('web')
->group('web_guest')
->action(EventHandlerAction::class, 'handle');
}
}
4 changes: 2 additions & 2 deletions app/src/Application/OAuth/SessionStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace App\Application\OAuth;

use Auth0\SDK\Contract\StoreInterface;
use Spiral\Session\SessionInterface;
use Spiral\Session\SessionScope;

final class SessionStore implements StoreInterface
{
public function __construct(
private readonly SessionInterface $session,
private readonly SessionScope $session,
private readonly string $sessionPrefix = 'auth0',
) {
}
Expand Down

0 comments on commit d533cba

Please sign in to comment.