Skip to content

Commit fd5a888

Browse files
authored
fix(route/twitter): await when get cache (#17429)
1 parent 0c506b8 commit fd5a888

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/routes/twitter/api/web-api/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import login from './login';
1414
let authTokenIndex = 0;
1515

1616
const token2Cookie = async (token) => {
17-
if (cache.get(`twitter:cookie:${token}`)) {
18-
return cache.get(`twitter:cookie:${token}`);
17+
const c = await cache.get(`twitter:cookie:${token}`);
18+
if (c) {
19+
return c;
1920
}
2021
const jar = new CookieJar();
2122
jar.setCookieSync(`auth_token=${token}`, 'https://x.com');

0 commit comments

Comments
 (0)