mirror of
https://gitea.phreedom.club/localhost_frssoft/dybr2fedi.git
synced 2024-11-23 20:11:27 +00:00
Auth check
This commit is contained in:
parent
300db5a278
commit
008c9d2230
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
default_auth_browser=links
|
default_auth_browser()
|
||||||
|
{
|
||||||
|
links $@
|
||||||
|
}
|
||||||
|
|
||||||
mkdir -m 711 -p .app_sessions
|
mkdir -m 711 -p .app_sessions
|
||||||
|
|
||||||
|
@ -16,6 +19,7 @@ auth_api_create_client()
|
||||||
--data-urlencode 'client_name=dybr2fedi bridge' \
|
--data-urlencode 'client_name=dybr2fedi bridge' \
|
||||||
--data-urlencode 'redirect_uris=urn:ietf:wg:oauth:2.0:oob' \
|
--data-urlencode 'redirect_uris=urn:ietf:wg:oauth:2.0:oob' \
|
||||||
--data-urlencode 'scopes=read write follow' \
|
--data-urlencode 'scopes=read write follow' \
|
||||||
|
--data-urlencode 'website=https://gitea.phreedom.club/localhost_frssoft/dybr2fedi' \
|
||||||
--output ".app_sessions/$instance" \
|
--output ".app_sessions/$instance" \
|
||||||
--create-file-mode 0600
|
--create-file-mode 0600
|
||||||
fi
|
fi
|
||||||
|
@ -47,3 +51,5 @@ auth_api_get_token()
|
||||||
chmod 600 .auth
|
chmod 600 .auth
|
||||||
echo "$token" > .auth
|
echo "$token" > .auth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auth_api_get_token
|
||||||
|
|
|
@ -14,6 +14,14 @@ touch $log_sended_articles
|
||||||
|
|
||||||
#[Fedi section]
|
#[Fedi section]
|
||||||
instance_point='https://expired.mentality.rip/api/v1'
|
instance_point='https://expired.mentality.rip/api/v1'
|
||||||
|
if [ ! -f .auth ]; then
|
||||||
|
"$basedir"/auth_helper.sh
|
||||||
|
if [ ! -f .auth ]; then
|
||||||
|
echo 'Failed, access denied'
|
||||||
|
else
|
||||||
|
echo 'OK! Success'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
auth=$(cat "$basedir"/.auth | tr -d '\n')
|
auth=$(cat "$basedir"/.auth | tr -d '\n')
|
||||||
post_request()
|
post_request()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue