Skip to content

Commit a5a9c10

Browse files
committed
close modal on custom domain logout, validate branding
1 parent f1ba0de commit a5a9c10

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

api/resolvers/branding.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { GqlAuthenticationError, GqlInputError } from '@/lib/error'
2+
import { validateSchema, customBrandingSchema } from '@/lib/validate'
23

34
export default {
45
Query: {
@@ -40,6 +41,19 @@ export default {
4041
}
4142
}
4243

44+
if (!validateSchema(customBrandingSchema, {
45+
title,
46+
primary: colors.primary,
47+
secondary: colors.secondary,
48+
info: colors.info,
49+
success: colors.success,
50+
danger: colors.danger,
51+
logoId,
52+
faviconId
53+
})) {
54+
throw new GqlInputError('invalid branding')
55+
}
56+
4357
// TODO: validation, even of logo and favicon.
4458

4559
return await models.customBranding.upsert({

components/nav/common.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ function LogoutObstacle ({ onClose }) {
351351
removeLocalWallets()
352352

353353
await signOut({ callbackUrl: '/', redirect: !customDomain })
354+
if (customDomain) {
355+
onClose()
356+
}
354357
}}
355358
>
356359
logout

0 commit comments

Comments
 (0)