+4
-4
src/lib/at/oauth.ts
+4
-4
src/lib/at/oauth.ts
···
1
1
import {
2
2
configureOAuth,
3
-
defaultIdentityResolver,
4
3
createAuthorizationUrl,
5
4
finalizeAuthorization,
6
5
OAuthUserAgent,
···
10
9
11
10
import {
12
11
CompositeDidDocumentResolver,
12
+
LocalActorResolver,
13
13
PlcDidDocumentResolver,
14
14
WebDidDocumentResolver,
15
15
XrpcHandleResolver
···
18
18
import type { ActorIdentifier } from '@atcute/lexicons';
19
19
import { err, ok, type Result } from '$lib/result';
20
20
import type { AtprotoDid } from '@atcute/lexicons/syntax';
21
-
import { clientId, redirectUri } from '$lib/oauth';
21
+
import { clientId, oauthMetadata, redirectUri } from '$lib/oauth';
22
22
23
23
configureOAuth({
24
24
metadata: {
25
25
client_id: clientId,
26
26
redirect_uri: redirectUri
27
27
},
28
-
identityResolver: defaultIdentityResolver({
28
+
identityResolver: new LocalActorResolver({
29
29
handleResolver: new XrpcHandleResolver({ serviceUrl: slingshotUrl.href }),
30
30
31
31
didDocumentResolver: new CompositeDidDocumentResolver({
···
57
57
try {
58
58
const authUrl = await createAuthorizationUrl({
59
59
target: { type: 'account', identifier },
60
-
scope: 'atproto transition:generic'
60
+
scope: oauthMetadata.scope
61
61
});
62
62
// recommended to wait for the browser to persist local storage before proceeding
63
63
await new Promise((resolve) => setTimeout(resolve, 200));
+1
-1
src/lib/oauth.ts
+1
-1
src/lib/oauth.ts
···
7
7
client_uri: domain,
8
8
logo_uri: `${domain}/favicon.png`,
9
9
redirect_uris: [`${domain}/`],
10
-
scope: 'atproto transition:generic',
10
+
scope: 'atproto repo:*?action=create&action=update&action=delete blob:*/*',
11
11
grant_types: ['authorization_code', 'refresh_token'],
12
12
response_types: ['code'],
13
13
token_endpoint_auth_method: 'none',