Skip to content

Commit

Permalink
Make all post calls to api
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmeyers committed Jul 28, 2023
1 parent 5cee9ad commit 42fda43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/dropbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DropboxHelper {

async init() {
try {
const resp = await axios.get("/api/refresh");
const resp = await axios.post("/api/refresh");
const accessToken = (resp.data as any).accessToken;
if (accessToken) {
this.dropbox = new Dropbox({
Expand Down Expand Up @@ -81,7 +81,7 @@ class DropboxHelper {
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get("code");
if (code) {
const resp = await axios.get("/api/auth?code=" + code + "&apikey=" + this.apiKey);
const resp = await axios.post("/api/auth?code=" + code + "&apikey=" + this.apiKey);
const accessToken = (resp.data as any).accessToken;
this.dropbox = new Dropbox({
clientId: CLIENT_ID,
Expand All @@ -91,7 +91,7 @@ class DropboxHelper {
}

async disconnect() {
await axios.get("/api/unauth");
await axios.post("/api/unauth");
this.dropbox = undefined;
localStorage.removeItem("dropbox.access_token");
}
Expand Down

0 comments on commit 42fda43

Please sign in to comment.