Skip to content

Commit

Permalink
Revert "Temporarily replace guest token email with print" (#144)
Browse files Browse the repository at this point in the history
This reverts commit 7bd7405.
  • Loading branch information
samderanova authored Dec 18, 2023
1 parent c55f24f commit 9c34d2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions apps/api/src/auth/guest_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from auth.user_identity import GuestUser, utc_now
from services import mongodb_handler
from services.mongodb_handler import BaseRecord, Collection

# from utils import email_handler
from utils import email_handler

AUTH_KEY_SALT = os.getenv("AUTH_KEY_SALT", "")[:16].encode()
PASSPHRASE_LENGTH = 4
Expand Down Expand Up @@ -51,8 +50,7 @@ async def initiate_guest_login(email: EmailStr) -> Optional[str]:
)

await _save_guest_key(guest)
print(email, passphrase)
# await email_handler.send_guest_login_email(email, passphrase)
await email_handler.send_guest_login_email(email, passphrase)

return confirmation

Expand Down
6 changes: 3 additions & 3 deletions apps/api/tests/test_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def test_guest_login_initiation(
),
)
)
# mock_send_guest_login_email.assert_awaited_once_with(
# SAMPLE_EMAIL, SAMPLE_PASSPHRASE
# )
mock_send_guest_login_email.assert_awaited_once_with(
SAMPLE_EMAIL, SAMPLE_PASSPHRASE
)

assert res.status_code == 303
assert res.headers["location"] == "/guest-login?email=beaver%40caltech.edu"
Expand Down

0 comments on commit 9c34d2c

Please sign in to comment.