pl-api: allow username+password log in with iceshrimp.net
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -104,7 +104,7 @@
|
||||
"multiselect-react-dropdown": "^2.0.25",
|
||||
"mutative": "^1.1.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"pl-api": "^1.0.0-rc.61",
|
||||
"pl-api": "^1.0.0-rc.62",
|
||||
"postcss": "^8.5.3",
|
||||
"process": "^0.11.10",
|
||||
"punycode": "^2.1.1",
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -6863,10 +6863,10 @@ pkg-dir@^4.1.0:
|
||||
dependencies:
|
||||
find-up "^4.0.0"
|
||||
|
||||
pl-api@^1.0.0-rc.61:
|
||||
version "1.0.0-rc.61"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.61.tgz#0d9969c9691e77109d3c66db02c55a0d866c1429"
|
||||
integrity sha512-fShtnSPaJ/EUMqExk/eV5nJHG4vfxMgQBS0Qdrqk9PNEVoWAaazkxa6nNoXDAZ0bx+39+JlS0DyOwoet5GkYRg==
|
||||
pl-api@^1.0.0-rc.62:
|
||||
version "1.0.0-rc.62"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.62.tgz#d838b1cde4b9b4d9ed986d99f503d8f460039088"
|
||||
integrity sha512-X6LN7fS874czsouIwBPx/nw7EGQtscJDixxkpF3fM7tQR8Ficn7dRfJuDgzpv1MLovxqnXC3Sn9TVVWWA+TCdg==
|
||||
dependencies:
|
||||
blurhash "^2.0.5"
|
||||
http-link-header "^1.1.3"
|
||||
|
||||
Reference in New Issue
Block a user