mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-05 15:57:23 +01:00
Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp
# Conflicts: # management/auth.py # management/daemon.py # management/mailconfig.py # setup/mail-users.sh
This commit is contained in:
@@ -7,3 +7,4 @@
|
||||
TEST_USER="totp_admin@$(email_domainpart "$EMAIL_ADDR")"
|
||||
TEST_USER_PASS="$(static_qa_password)"
|
||||
TEST_USER_TOTP_SECRET="6VXVWOSCY7JLU4VBZ6LQEJSBN6WYWECU"
|
||||
TEST_USER_TOTP_LABEL="my phone"
|
||||
|
||||
@@ -27,7 +27,8 @@ then
|
||||
fi
|
||||
|
||||
# enable totp
|
||||
if ! rest_urlencoded POST "${url%/}/admin/mfa/totp/enable" "$TEST_USER" "$TEST_USER_PASS" --insecure "secret=$TEST_USER_TOTP_SECRET" "token=$(totp_current_token "$TEST_USER_TOTP_SECRET")" 2>/dev/null; then
|
||||
token="$(totp_current_token "$TEST_USER_TOTP_SECRET")"
|
||||
if ! rest_urlencoded POST "${url%/}/admin/mfa/totp/enable" "$TEST_USER" "$TEST_USER_PASS" --insecure "secret=$TEST_USER_TOTP_SECRET" "token=$token" "label=$TEST_USER_TOTP_LABEL" 2>/dev/null; then
|
||||
echo "Unable to enable TOTP. err=$REST_ERROR" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -27,7 +27,7 @@ if [ -z "$ATTR_DN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$ATTR_VALUE" != "$TEST_USER_TOTP_SECRET" ]; then
|
||||
if [ "$ATTR_VALUE" != "{0}$TEST_USER_TOTP_SECRET" ]; then
|
||||
echo "totpSecret mismatch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user