Skip to content

Commit

Permalink
Add get_url_of_login_page to LeetCodeService
Browse files Browse the repository at this point in the history
To enable logging in to LeetCode using
https://github.com/online-judge-tools/oj/
  • Loading branch information
usk83 committed Oct 16, 2020
1 parent 7f390f5 commit b4fde5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions onlinejudge/service/leetcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def from_url(cls, url: str) -> Optional['LeetCodeService']:
return None
return cls()

def get_url_of_login_page(self) -> str:
return f'{self.get_url()}accounts/login/'

def is_logged_in(self, *, session: Optional[requests.Session] = None) -> bool:
session = self._set_request_header(session)
json_body = {
Expand Down

0 comments on commit b4fde5f

Please sign in to comment.