Closed cpartica closed 4 years ago
PWA client needs to know what queries require authentication
Can we include an example use-case?
Would love to see prior art in this proposal, i.e examples of how other applications are handling a mix of authenticated and anonymous queries
We originally asked for this because the PWA UX guidelines require that login state behave much like traditional sessions:
Since the PWA's thin backend doesn't create a session, it uses customer auth tokens alone to manage login. Those tokens always expire after a certain TTL, whether they're still being used or not. This has the unfortunate effect of unexpectedly logging a customer out, after an hour of using the site.
Our first idea was to let sessions expire and solve (2) above by using cached user data to "simulate" a logged-in state. However, that meant removing the expired token and popping a login only when the user tries to access a privileged value in the graph. Therefore, we wanted to optimize our fake-warm-auth experience by knowing ahead of time which queries would require login. That's why we proposed the @auth schema directive.
However, after speaking with @cpartica and @nrkapoor a bit more, we really need to solve (1) above by adding refresh tokens and readable TTLs. Right now, users get unexpectedly logged out; it's a high-priority, high-severity issue, and once it's solved, we don't really need the auth directive anymore.
However, after speaking with @cpartica and @nrkapoor a bit more, we really need to solve (1) above by adding refresh tokens and readable TTLs. Right now, users get unexpectedly logged out; it's a high-priority, high-severity issue, and once it's solved, we don't really need the auth directive anymore.
Can we get clarification about what we're looking to proceed with? Not totally clear whether the ask is for @auth
until token refresh exists, or if the ask if to build the token refresh functionality now and skip this auth
proposal
Any updates @zetlen @cpartica?
yes, we close this out, it's not needed for the time beng
Problem
PWA client needs to know what queries require authentication
Solution
Add @auth annotation to schema
Requested Reviewers
@paliarush @zetlen