Skip to content

Commit

Permalink
fix: update login script (#44)
Browse files Browse the repository at this point in the history
close #44
  • Loading branch information
yanglbme committed Nov 23, 2021
1 parent 046710a commit cf34017
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def login(self):

# https://assets.gitee.com/assets/encrypt.js
separator = '$gitee$'
data = f'{csrf_token}{separator}{self.password}'
data = f'{csrf_token[-8:]}{separator}{self.password}'
pubkey = rsa.PublicKey.load_pkcs1_openssl_pem(PUBLIC_KEY.encode())
encrypt_data = rsa.encrypt(data.encode(), pubkey)
encrypt_data = base64.b64encode(encrypt_data).decode()
Expand Down
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from app.action import Action

username = 'yanglbme'
password = '*******'
repo = 'doocs/advanced-java'
password = '***'
repo = 'yanglbme/reading'
branch = 'main'

action = Action(username, password, repo, branch)
Expand Down

0 comments on commit cf34017

Please sign in to comment.