refactor(all): prefer token-based authentication

This commit is contained in:
vulet 2021-01-17 17:58:02 +08:00
parent 9e17440abc
commit f69b52261a
24 changed files with 166 additions and 117 deletions

View file

@ -4,7 +4,7 @@ exports.runQuery = function (matrixClient, room, registrar) {
axios({
method: 'POST',
url: `${registrar.config.fediverse.domain}/api/v1/statuses`,
headers: { Authorization: `Bearer ${registrar.config.fediverse.token}` },
headers: { Authorization: `Bearer ${registrar.fediverse_auth.access_token}` },
data: { status: `@10grans@fedi.cc beg` },
}).then((response) => {
matrixClient.sendHtmlNotice(room.roomId,
@ -18,4 +18,4 @@ exports.runQuery = function (matrixClient, room, registrar) {
matrixClient.sendHtmlNotice(room.roomId,
'', `${e}`);
});
};
};