MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / authorized

Function authorized

src/background/sync/dropbox.js:139–157  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

137 openAuthPage(url, config.redirect_uri);
138 },
139 async authorized(params) {
140 const data = await this.loadData({
141 method: 'POST',
142 url: 'https://api.dropbox.com/oauth2/token',
143 headers: {
144 'Content-Type': FORM_URLENCODED,
145 },
146 body: dumpQuery({
147 client_id: config.client_id,
148 ...params,
149 }),
150 responseType: 'json',
151 });
152 if (!data.access_token) throw data;
153 this.config.set({
154 token: data.access_token,
155 refresh_token: data.refresh_token || params.refresh_token,
156 });
157 },
158 matchAuth(url) {
159 const redirectUri = `${config.redirect_uri}?`;
160 if (!url.startsWith(redirectUri)) return;

Callers

nothing calls this directly

Calls 2

dumpQueryFunction · 0.90
setMethod · 0.80

Tested by

no test coverage detected