From 10ee5ca049bdab55a85fce0bb3ea3bfacb118782 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sat, 8 Apr 2023 15:23:21 +0800 Subject: [PATCH] fix(remote_judger/codeforces): login check ref: https://github.com/hydro-dev/Hydro/commit/9f1169b3e054a36686262d83db3763f30a329940 --- remote_judger/src/providers/codeforces.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/remote_judger/src/providers/codeforces.ts b/remote_judger/src/providers/codeforces.ts index 8ec9977..e4985aa 100644 --- a/remote_judger/src/providers/codeforces.ts +++ b/remote_judger/src/providers/codeforces.ts @@ -169,11 +169,9 @@ export default class CodeforcesProvider implements IBasicProvider { } get loggedIn() { - return this.get('/enter').then(res => { + return this.get('/').then(res => { const html = res.text; - if (html.includes('Login into Codeforces')) return false; - if (html.length < 1000 && html.includes('Redirecting...')) { logger.debug('Got a redirect', html); return false; @@ -188,7 +186,7 @@ export default class CodeforcesProvider implements IBasicProvider { if (_39ce7) this.setCookie('39ce7', _39ce7); } - return true; + return html.includes('header-bell__img'); }); }