Customize route for first signin for tracking

This commit is contained in:
Tom Moor
2018-12-08 08:57:34 -08:00
parent d3911b9e20
commit b068ba9f02
3 changed files with 6 additions and 6 deletions

View File

@@ -46,7 +46,7 @@ router.get('slack.callback', auth({ required: false }), async ctx => {
},
});
const [user] = await User.findOrCreate({
const [user, isFirstSignin] = await User.findOrCreate({
where: {
service: 'slack',
serviceId: data.user.id,
@@ -66,7 +66,7 @@ router.get('slack.callback', auth({ required: false }), async ctx => {
}
// set cookies on response and redirect to team subdomain
ctx.signIn(user, team, 'slack');
ctx.signIn(user, team, 'slack', isFirstSignin);
});
router.get('slack.commands', auth(), async ctx => {