ocw/webroot/api/smscode_send.shs

17 lines
549 B
Bash

#!/bin/bash
# stolen from mailcode.shs - probably should be merged sometime
if ! session_verify "${cookies[sh_session]}"; then
jq -n '{status: $ARGS.positional[0], msg: $ARGS.positional[1]}' --args -1 "You're not logged in!"
return
fi
source "${cfg[namespace]}/code/common.sh"
if [[ "${post_data[phone]}" != '' ]]; then
x=''
while [[ "$x" == '' ]]; do
x=$(curl -s "https://api-inmobile-pl.easypack24.net/v1/sendSMSCode/${post_data[phone]}")
done
jq -n '{status: $ARGS.positional[0], msg: $ARGS.positional[1]}' --args 200 "sent request"
fi