MCPcopy
hub / github.com/jvilk/BrowserFS / auth

Function auth

test/harness/factories/dbfs_factory.ts:9–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7 key: 'c6oex2qavccb2l3'
8 }),
9 auth = () => {
10 init_client.authenticate((error: Dropbox.AuthError | Dropbox.ApiError, authed_client: Dropbox.Client) => {
11 if (error) {
12 console.error('Error: could not connect to Dropbox');
13 console.error(error);
14 return cb('Dropbox', []);
15 }
16
17 authed_client.getAccountInfo((error, info) => {
18 console.debug("Successfully connected to " + info.name + "'s Dropbox");
19 });
20
21 DropboxFileSystem.Create({
22 client: authed_client
23 }, (e, fs) => {
24 if (e) {
25 throw e;
26 } else {
27 fs.empty((e) => {
28 if (e) {
29 throw e;
30 } else {
31 cb('Dropbox', [fs]);
32 }
33 });
34 }
35 });
36 });
37 };
38
39 // Authenticate with pregenerated unit testing credentials.
40 var req = new XMLHttpRequest();

Callers 1

DBFSFactoryFunction · 0.85

Calls 4

cbFunction · 0.85
errorMethod · 0.80
CreateMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected