Skip to content

AttributeError in OAuth2ExtraTokenMiddleware middleware when a swapped AccessToken is used. #1381

@lazToum

Description

@lazToum

Describe the bug

When a custom AccessToken is used, the OAuth2ExtraTokenMiddleware raises an AttributeError: Manager isn't available; 'oauth2_provider.AccessToken' has been swapped for ...

To Reproduce

Use a custom OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL and enable the oauth2_provider.middleware.OAuth2ExtraTokenMiddleware
Expected behavior

No error to be raised.
Version

  • [NA] I have tested with the latest published release and it's still a problem.
  • I have tested with the master branch and it's still a problem.

Additional context

A simple change is proposed in #1380

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions