Fix check auth

This commit is contained in:
localhost_frssoft 2022-08-17 08:25:17 +03:00
parent 008c9d2230
commit df930ba91d
2 changed files with 6 additions and 5 deletions

View File

@ -47,9 +47,9 @@ auth_api_get_token()
--data-urlencode "redirect_uri=urn:ietf:wg:oauth:2.0:oob" \
--data-urlencode 'scope=read write follow' \
--data-urlencode "code=$pass" | jj access_token)
echo > .auth
chmod 600 .auth
echo "$token" > .auth
echo > "$basedir"/.auth
chmod 600 "$basedir"/.auth
echo "$token" > "$basedir"/.auth
}
auth_api_get_token

View File

@ -14,9 +14,10 @@ touch $log_sended_articles
#[Fedi section]
instance_point='https://expired.mentality.rip/api/v1'
if [ ! -f .auth ]; then
if [ ! -f "$basedir"/.auth ]; then
export basedir
"$basedir"/auth_helper.sh
if [ ! -f .auth ]; then
if [ ! -f "$basedir"/.auth ]; then
echo 'Failed, access denied'
else
echo 'OK! Success'