MCPcopy Index your code
hub / github.com/Tatamo/atcoder-cli / check

Method check

src/atcoder.ts:46–56  ·  view source on GitHub ↗

* アクセスしてログインしている状態かどうかを取得する(結果をキャッシュしない)

()

Source from the content-addressed store, hash-verified

44 * アクセスしてログインしている状態かどうかを取得する(結果をキャッシュしない)
45 */
46 private async check(): Promise<boolean> {
47 // ログインせず提出ページにアクセスするとコンテストトップに飛ばされることを利用する
48 const url = `${AtCoder.getContestURL("abc001")}/submit`;
49 // リダイレクトを無効化・302コードを容認して通信
50 const response = await this.session.get(url, {
51 maxRedirects: 0,
52 validateStatus: (status) => (status >= 200 && status < 300) || status === 302
53 });
54 // リダイレクトされなければログインしている
55 return response.status !== 302;
56 }
57
58 /**
59 * ログイン処理します

Callers 1

checkSessionMethod · 0.95

Calls 2

getContestURLMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected