Skip to content

Commit

Permalink
Add support for email sign in codes
Browse files Browse the repository at this point in the history
Fixes #1183
  • Loading branch information
delivrance committed Dec 30, 2022
1 parent 5d3abd3 commit 1e6209d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyrogram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ async def authorize(self) -> User:
enums.SentCodeType.CALL: "phone call",
enums.SentCodeType.FLASH_CALL: "phone flash call",
enums.SentCodeType.FRAGMENT_SMS: "Fragment SMS",
enums.SentCodeType.EMAIL_CODE: "email code"
}

print(f"The confirmation code has been sent via {sent_code_descriptions[sent_code.type]}")
Expand Down
3 changes: 3 additions & 0 deletions pyrogram/enums/sent_code_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ class SentCodeType(AutoName):

FRAGMENT_SMS = raw.types.auth.SentCodeTypeFragmentSms
"The code was sent via Fragment SMS."

EMAIL_CODE = raw.types.auth.SentCodeTypeEmailCode
"The code was sent via email."

0 comments on commit 1e6209d

Please sign in to comment.