Allow Slack integration setup for Google Auth accounts

This commit is contained in:
Tom Moor
2018-08-02 23:26:44 -07:00
parent cdd1fc4fb7
commit 662f908c76
2 changed files with 9 additions and 17 deletions

View File

@@ -24,10 +24,12 @@ export default function auth(options?: { required?: boolean } = {}) {
);
}
// $FlowFixMe
} else if (ctx.body.token) {
} else if (ctx.body && ctx.body.token) {
token = ctx.body.token;
} else if (ctx.request.query.token) {
token = ctx.request.query.token;
} else if (ctx.cookies.get('accessToken')) {
token = ctx.cookies.get('accessToken');
}
if (!token && options.required !== false) {
@@ -84,7 +86,7 @@ export default function auth(options?: { required?: boolean } = {}) {
ctx.state.token = token;
ctx.state.user = user;
// $FlowFixMe
if (!ctx.cache) ctx.cache = {};
ctx.cache[user.id] = user;
}