mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 06:53:10 +02:00
upd: also split by +
This commit is contained in:
parent
58988c2b3c
commit
487e397810
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ export async function ApiAuthMastodon(request: FastifyRequest, client: Megalodon
|
||||||
const body: any = request.body || request.query;
|
const body: any = request.body || request.query;
|
||||||
try {
|
try {
|
||||||
let scope = body.scopes;
|
let scope = body.scopes;
|
||||||
if (typeof scope === 'string') scope = scope.split(' ');
|
if (typeof scope === 'string') scope = scope.split(' ') || scope.split('+');
|
||||||
const pushScope = new Set<string>();
|
const pushScope = new Set<string>();
|
||||||
for (const s of scope) {
|
for (const s of scope) {
|
||||||
if (s.match(/^read/)) for (const r of readScope) pushScope.add(r);
|
if (s.match(/^read/)) for (const r of readScope) pushScope.add(r);
|
||||||
|
|
Loading…
Reference in a new issue