mirror of
https://github.com/remotely-save/remotely-save.git
synced 2024-06-07 21:10:45 +00:00
fix onedrive auth process
This commit is contained in:
parent
d53569fe71
commit
02e5f9b5a0
17
src/main.ts
17
src/main.ts
@ -105,6 +105,16 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
"remotely-save-cb-onedrive",
|
||||
async (inputParams) => {
|
||||
if (inputParams.code !== undefined) {
|
||||
if (this.oauth2Info.helperModal !== undefined) {
|
||||
this.oauth2Info.helperModal.contentEl.empty();
|
||||
this.oauth2Info.helperModal.contentEl.createEl("p", {
|
||||
text: "Connecting to Onedrive...",
|
||||
});
|
||||
this.oauth2Info.helperModal.contentEl.createEl("p", {
|
||||
text: "Please DO NOT close this modal.",
|
||||
});
|
||||
}
|
||||
|
||||
let rsp = await sendAuthReqOnedrive(
|
||||
this.settings.onedrive.clientID,
|
||||
this.settings.onedrive.authority,
|
||||
@ -116,13 +126,6 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
throw Error(`${JSON.stringify(rsp)}`);
|
||||
}
|
||||
|
||||
if (this.oauth2Info.helperModal !== undefined) {
|
||||
this.oauth2Info.helperModal.contentEl.empty();
|
||||
this.oauth2Info.helperModal.contentEl.createEl("p", {
|
||||
text: "Please wait, the plugin is trying to connect to Onedrive...",
|
||||
});
|
||||
}
|
||||
|
||||
rsp = rsp as AccessCodeResponseSuccessfulType;
|
||||
this.settings.onedrive.accessToken = rsp.access_token;
|
||||
this.settings.onedrive.accessTokenExpiresAtTime =
|
||||
|
Loading…
Reference in New Issue
Block a user