Added cookie to indicate logged in status

This commit is contained in:
Jori Lallo
2017-10-11 00:14:45 -07:00
parent 4dacef7f1e
commit 42ed9616b5
6 changed files with 48 additions and 21 deletions

View File

@ -47,6 +47,14 @@ router.post('auth.slack', async ctx => {
await team.createFirstCollection(user.id);
}
// Signal to backend that the user is logged in.
// This is only used to signal SSR rendering, not
// used for auth.
ctx.cookies.set('loggedId', 'true', {
httpOnly: false,
expires: new Date('2100'),
});
ctx.body = {
data: {
user: await presentUser(ctx, user),