react-auth-client icon indicating copy to clipboard operation
react-auth-client copied to clipboard

Open socket only on auth

Open christophrus opened this issue 5 years ago • 1 comments

Because I was wondering if it isn’t a waste of resources to open a socket every time someone hits the site, e.g. when the login buttons are implemented into the header and they don't even intend to login, I decided to modify your example a bit to let it only open a socket when someone actually hits the login button, and also close the socket after the login is done.

christophrus avatar Jul 16 '19 18:07 christophrus

Thanks Christopher! Going to leave this open in case other folks are looking to solve the same problem they can grab your branch. Cheers

funador avatar Jul 16 '19 21:07 funador