chore: Upgrade Flow to v0.104.0
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user