Browse Source
Merge pull request #4023 from Budibase/403-templates
Handle 403 when loading templates
master
Rory Powell
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
1 deletions
-
packages/builder/src/builderStore/api.js
-
packages/server/src/integrations/s3.ts
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
import { store } from "./index" |
|
|
|
import { get as svelteGet } from "svelte/store" |
|
|
|
import { removeCookie, Cookies } from "./cookies" |
|
|
|
import { notifications } from "@budibase/bbui" |
|
|
|
|
|
|
|
const apiCall = |
|
|
|
method => |
|
|
|
@ -13,6 +14,12 @@ const apiCall = |
|
|
|
headers, |
|
|
|
}) |
|
|
|
if (resp.status === 403) { |
|
|
|
if (url.includes("/api/templates")) { |
|
|
|
notifications.error( |
|
|
|
"There was a problem loading quick start templates." |
|
|
|
) |
|
|
|
return { json: () => [] } |
|
|
|
} |
|
|
|
removeCookie(Cookies.Auth) |
|
|
|
// reload after removing cookie, go to login
|
|
|
|
if (!url.includes("self") && !url.includes("login")) { |
|
|
|
|
|
|
|
@ -38,7 +38,7 @@ module S3Module { |
|
|
|
signatureVersion: { |
|
|
|
type: "string", |
|
|
|
required: false, |
|
|
|
default: "v4" |
|
|
|
default: "v4", |
|
|
|
}, |
|
|
|
}, |
|
|
|
query: { |
|
|
|
|