You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
323 B
Bash

#!/bin/bash
set -e
domain=$1
login_data=$2
if [ -z $domain -o -z $login_data ]; then
echo "Usage: $0 \"https://matrix.server\" <LOGIN_FILE>"
exit 0
fi
token=$(cat $login_data | jq -r '.access_token')
echo "Logging user out ..."
curl -XPOST -H "Authorization: Bearer $token" "$domain/_matrix/client/r0/logout"