Skip to content

Commit

Permalink
fix qr code
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed May 19, 2024
1 parent 348b2a5 commit fede97b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from MagicalAuth import MagicalAuth
import qrcode
import pyotp
import io


def login_page():
Expand Down Expand Up @@ -40,10 +41,13 @@ def login_page():
qr.add_data(mfa_token)
qr.make(fit=True)
img = qr.make_image(fill_color="black", back_color="white")
img_bytes = io.BytesIO()
img.save(img_bytes, format="PNG")
img_bytes = img_bytes.getvalue()
st.write(
"Registration successful! Please add the MFA token to your authenticator app."
)
st.image(img, caption="Scan this QR code to enable MFA")
st.image(img_bytes, caption="Scan this QR code to enable MFA")
mfa_confirm = st.text_input(
"Enter the MFA token from your authenticator app"
)
Expand Down

0 comments on commit fede97b

Please sign in to comment.