From 0b20e0d44797818b6513c88ea7c4708105309d6a Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Mon, 10 May 2021 20:00:04 +0500 Subject: [PATCH] Fixed issue with accounts with multiple profiles --- welcome.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/welcome.sh b/welcome.sh index 5acbcf8..71b84d8 100644 --- a/welcome.sh +++ b/welcome.sh @@ -1,5 +1,11 @@ #Requesting for User profile after login and regex to grap the Full name -curl -s -b $COOKIE $BML_URL/profile > /dev/null +REQPRO=$(curl -s -b $COOKIE $BML_URL/profile) +PERSONALPROFILE=$(echo $REQPRO \ + | jq -r '.payload | .profile | .[] | .profile' \ + | head -n 1) +curl -s -b $COOKIE $BML_URL/profile \ + --data-raw profile=$PERSONALPROFILE \ + --compressed > /dev/null USERINFO=$(curl -s -b $COOKIE $BML_URL/userinfo \ | jq -r '.["payload"] | .["user"]')