pl-api: allow username+password log in with iceshrimp.net

Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
Nicole Mikołajczyk
2025-05-21 18:38:06 +02:00
parent 5472c4b408
commit 817f1b083d
9 changed files with 81 additions and 12 deletions

View File

@ -13,8 +13,9 @@ import { getBaseURL } from 'pl-fe/utils/state';
import type { AppDispatch, RootState } from 'pl-fe/store';
const obtainOAuthToken = (params: GetTokenParams, baseURL?: string) =>{
const obtainOAuthToken = async (params: GetTokenParams, baseURL?: string) =>{
const client = new PlApiClient(baseURL || BuildConfig.BACKEND_URL || '');
await client.instance.getInstance();
return client.oauth.getToken(params);
};

View File

@ -12,6 +12,9 @@ const getInstanceScopes = (instance: Instance, admin: boolean = true) => {
let scopes;
switch (v.software) {
case ICESHRIMP_NET:
scopes = 'read write follow push iceshrimp';
break;
case TOKI:
scopes = 'read write follow push write:bites';
break;