mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-23 12:43:33 +02:00
Added auto auth change when switch instance
This commit is contained in:
parent
08f64d737a
commit
bd5a14234f
1 changed files with 14 additions and 0 deletions
|
@ -324,6 +324,20 @@ case "$choice" in
|
|||
echo ''
|
||||
fi
|
||||
clear
|
||||
export auth="$(jj -i .auth.json "$(echo $instance | sed 's/\./\\\./g')")"
|
||||
if [ -n "$auth" ]; then
|
||||
default_curl_opt()
|
||||
{
|
||||
curl -s --compressed -H "Authorization: Bearer $auth" $1
|
||||
}
|
||||
listen_token=$(default_curl_opt "$instance_point/users/me" | jj tokens.listen)
|
||||
echo '+Authorized account+'
|
||||
else
|
||||
default_curl_opt()
|
||||
{
|
||||
curl -s --compressed $1
|
||||
}
|
||||
fi
|
||||
get_all_avalaible_count_tracks
|
||||
fi ;;
|
||||
|
||||
|
|
Loading…
Reference in a new issue