groton-school / knowledgebase

Knowledgebase website
https://kb.groton.org
GNU General Public License v3.0
0 stars 0 forks source link

Handle all refresh token issues in `Auth` #41

Open github-actions[bot] opened 1 month ago

github-actions[bot] commented 1 month ago

req.session.redirect \= req.url.replace(`https://$\{req\.host}`, '');

https://github.com/groton-school/knowledgebase/blob/8f2f2cf310aa1beb23977286c6176fcebfb9b634/apps/router/src/Handlers/Factories/CloudStorageRouter.ts#L105


        } catch (error) {
          if (error == 'Error: No refresh token is set.') {
            // silent login if refresh token not present
            // TODO this should be caught/handled in Auth.authorize, not here
            req.session.redirect = req.url.replace(`https://${req.host}`, '');
            res.redirect(Auth.authUrl);
          } else {