From 7a08cec3364dbf766e09ffd452e6f4fddc20eac0 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sat, 8 May 2021 19:29:58 +0500 Subject: [PATCH] logout after password change --- changepassword.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/changepassword.sh b/changepassword.sh index 71958dc..a1df7ee 100644 --- a/changepassword.sh +++ b/changepassword.sh @@ -55,7 +55,6 @@ else : fi - if [ "$OTPCHANNEL" = "mobile" ] then ECHOOTPCHANNEL=$PHONE @@ -77,13 +76,15 @@ PASSCHANGED=$(curl -s -b $COOKIE $BML_URL/user/changepassword \ --compressed \ | jq -r .success) +OLD_PASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5) +NEW_PASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5) +REPEAT_NEWPASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5) + if [ "$PASSCHANGED" != "true" ] then echo "${red}Failed to change password${reset}" else echo "${lightgreen}Password changed succesfully ${reset}" - OLD_PASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5) - NEW_PASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5) - REPEAT_NEWPASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5) - source settings-menu.sh + rm $CREDENTIALS + source readpass.sh fi