You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.
I initialize my Storage together with my Authenticator as part of a single service in my DI container. So, it would be helpful if I could access Storage (for example, to call cleanAllTriplets) through the Authenticator instance.
The text was updated successfully, but these errors were encountered:
Interesting idea, however, I'd like to know more about your use case. Just implementing getStorage would violate the Law of Demeter. It would be better in this case if you code requested the storage from your DI and manipulated directly.
I ended up creating a manager class for my authentication system, which encapsulates both the Storage and Authenticator. So, I'm not sure if this is still an issue for me.
I encountered something similar when integrating this library.
When creating a manager class for encapsulating i added a complete logout method like the one in your examples. But when doing so i needed to get the credential for the cleanAllTiplets call.
So my result was something like this: $triplet = Triplet::fromString($this->authenticator->getCookie()->getValue()); $this->storage->cleanAllTriplets($triplet->getCredential()); $this->authenticator->clearCookie();
So in my case i needed to add the Triplet::fromString on my cookie value in order to clean the storage triplets. Would it not be nicer if the cleanAllTriplets call would be on my authenticator? Maybe with a better name, but then you could internally get the credentials from the active cookie and do a call on the Storage dependency to delete the triplets from storage?
Just opening the conversation on this. There might be something i missed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I initialize my
Storage
together with myAuthenticator
as part of a single service in my DI container. So, it would be helpful if I could accessStorage
(for example, to callcleanAllTriplets
) through theAuthenticator
instance.The text was updated successfully, but these errors were encountered: