Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making AuthResponse public so as to use this: "directus.auth.storage.storeLoginData(data)" #64

Open
prnv2210 opened this issue Apr 28, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@prnv2210
Copy link

This is to set accesstoken and refresh token manually. Saw a method storeLoginData() for this, but it expects AuthResponse as param, which is a private class.

It would be helpful if it could be made accessible.

@apstanisic
Copy link
Owner

There are a couple of things that must happen when you set access token, look at login method.
It would leave library state in incorrect state

Should be something like this:

      await storage.storeLoginData(data);

      tokens = loginDataResponse;
      currentUser = CurrentUser(client: client);
      tfa = Tfa(client: client);

I am open for PR that adds additional method on auth_handler.dart, something like

Future<void> setAuthState(...) {
///
}

@apstanisic apstanisic added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants