pl-api: allow username+password log in with iceshrimp.net
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -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);
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user