random42 / passport-spid

Passport strategy for SPID (italian citizens) authentication
MIT License
12 stars 5 forks source link

why is a cache necessary? #9

Closed fautore closed 2 months ago

fautore commented 2 months ago

Hi all, basically what the title says, is a cache really necessary? can it be optional?

random42 commented 2 months ago

An external cache is necessary if your backend runs in a distributed way, on more than one instance. Otherwise you can pass a normal JavaScript Map as documented.

fautore commented 2 months ago

what happens if my backend is distributed and i still use a js map?

random42 commented 2 months ago

One instance may initiate the session but the final redirect may end up on another instance, which does not have the session in cache. I'm closing the issue.