Skip to content

Ngstack 1017 extending refresh token#6

Merged
emodric merged 6 commits into
masterfrom
NGSTACK-1017-extending-refresh-token
Feb 26, 2026
Merged

Ngstack 1017 extending refresh token#6
emodric merged 6 commits into
masterfrom
NGSTACK-1017-extending-refresh-token

Conversation

@JakovKnezovicc

Copy link
Copy Markdown
Contributor

• Adds user-aware JWT refresh support and fixes refresh token mapping integration.

  • Introduces api_platform_extras.features.jwt_refresh.user_aware to validate provider compatibility against the stored user class on refresh tokens.
  • Refactors refresh token model/entity to bundle-level namespaces (Netgen\ApiPlatformExtras\Model and Netgen\ApiPlatformExtras\Entity) for cleaner Doctrine discovery.
  • Adds Doctrine XML mapping for the extended refresh token (class field + inherited base fields).
  • Updates bundle path resolution for mapping autodiscovery from package root.
  • Updates README with new config option and the correct custom entity extension example.

Comment thread src/Model/UserAwareRefreshToken.php Outdated
public static function createForUserWithTtl(string $refreshToken, UserInterface $user, int $ttl): static
{
return parent::createForUserWithTtl($refreshToken, $user, $ttl)
->setClass($user::class);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add the gesdinet bundle to dependencies (at least require-dev and suggests).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its under required, should it be moved to require-dev? Whole refresh feature relies heavy on its existence.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's okay, i presumed it's missing since PHPStan complained.

As for require-dev, I don't know really. It makes sense for it to go to require-dev as the feature is not required 100%, so you throw an exception if you enable the feature and the bundle is not installed and enabled.

But the way it is now is okay enough for now.

@emodric emodric merged commit 3fae64b into master Feb 26, 2026
2 checks passed
@emodric emodric deleted the NGSTACK-1017-extending-refresh-token branch February 26, 2026 09:54
@emodric

emodric commented Feb 26, 2026

Copy link
Copy Markdown
Member

Thanks @JakovKnezovicc !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants