chore: Upgrade Flow to v0.104.0

This commit is contained in:
Tom Moor
2020-08-08 16:26:20 -07:00
parent e9387db895
commit c6d2467fae
131 changed files with 9151 additions and 3089 deletions

View File

@ -60,7 +60,8 @@ export default function auth(options?: { required?: boolean } = {}) {
user = await User.findByPk(apiKey.userId);
if (!user) throw new AuthenticationError("Invalid API key");
} else {
// JWT
/* $FlowFixMeNowPlease This comment suppresses an error found when upgrading
* flow-bin@0.104.0. To view the error, delete this comment and run Flow. */
user = await getUserForJWT(token);
}
@ -75,9 +76,17 @@ export default function auth(options?: { required?: boolean } = {}) {
// not awaiting the promise here so that the request is not blocked
user.updateActiveAt(ctx.request.ip);
/* $FlowFixMeNowPlease This comment suppresses an error found when upgrading
* flow-bin@0.104.0. To view the error, delete this comment and run Flow. */
ctx.state.token = token;
/* $FlowFixMeNowPlease This comment suppresses an error found when upgrading
* flow-bin@0.104.0. To view the error, delete this comment and run Flow. */
ctx.state.user = user;
if (!ctx.cache) ctx.cache = {};
/* $FlowFixMeNowPlease This comment suppresses an error found when upgrading
* flow-bin@0.104.0. To view the error, delete this comment and run Flow. */
ctx.cache[user.id] = user;
}