mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
fix(api): validate push and domain verification targets (#2346)
This commit is contained in:
1 parent
693aec2b4d
commit
1d84689b45
5 files changed
+75
-3
No files matched your search
@@ -514,6 +514,13 @@ export const RegisterMobileDeviceRequest = z
|
||||
})
|
||||
.superRefine((value, ctx) => {
|
||||
if (value.platform !== 'android_unified_push') return;
|
||||
if (!URLType.safeParse(value.token).success) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ['token'],
|
||||
message: 'UnifiedPush registrations require a valid endpoint URL',
|
||||
});
|
||||
}
|
||||
if (!value.encryption_key) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
|
||||
Reference in new issue
Block a user