17 lines
703 B
Plaintext
17 lines
703 B
Plaintext
|
#!/bin/bash
|
||
|
if ! session_verify ${cookies[sh_session]}; then
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
if [[ ${get_data[phone]} != "" && ${post_data[code]} != "" ]]; then
|
||
|
tokens=$(curl -s -X POST -H "Content-type: application/json" --data '{"phoneOS":"Android"}' "https://api-inmobile-pl.easypack24.net/v1/confirmSMSCode/${get_data[phone]}/${post_data[code]}")
|
||
|
|
||
|
if [[ $(echo $tokens | jq .status) == "404" ]]; then
|
||
|
jq -n '{status: $ARGS.positional[0], error: $ARGS.positional[1]}' --args -1 "wrongData"
|
||
|
else
|
||
|
add_account_refreshtoken $(echo $tokens | jq -r .refreshToken)
|
||
|
add_account_authtoken $(echo $tokens | jq -r .authToken)
|
||
|
jq -n '{status: $ARGS.positional[0], error: $ARGS.positional[1]}' --args 200 "success"
|
||
|
fi
|
||
|
fi
|