mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
bugfix: timezone issue with template block cutoff date (#46601)
Fix to small issue with our block to free tier. The /project endpoint does not return a timestamp so it is being interpreted as local. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Resolved timezone handling inconsistencies in email template availability checks to ensure accurate and consistent results across all geographic locations and server configurations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
1 parent
00d530d54a
commit
2b1ba50753
1 file changed
+4
-1
@@ -1,10 +1,13 @@
|
||||
import dayjs from 'dayjs'
|
||||
import utc from 'dayjs/plugin/utc'
|
||||
|
||||
import { isSmtpEnabled } from '../SmtpForm/SmtpForm.utils'
|
||||
import { type AuthTemplateType, type KebabCase } from './EmailTemplates.types'
|
||||
import type { components } from '@/data/api'
|
||||
import type { Organization } from '@/types'
|
||||
|
||||
dayjs.extend(utc)
|
||||
|
||||
type AuthConfig = components['schemas']['GoTrueConfigResponse']
|
||||
|
||||
/**
|
||||
@@ -46,7 +49,7 @@ export const isCustomEmailTemplateRestrictionStatusKnown = ({
|
||||
}
|
||||
|
||||
export const isBeforeFreeTierTemplateBlockCutoff = (projectInsertedAt?: string) => {
|
||||
return dayjs(projectInsertedAt).isBefore(FREE_TIER_TEMPLATE_BLOCK_CUTOFF_DATE)
|
||||
return dayjs.utc(projectInsertedAt).isBefore(FREE_TIER_TEMPLATE_BLOCK_CUTOFF_DATE)
|
||||
}
|
||||
|
||||
export const isCustomEmailTemplateEditingRestricted = ({
|
||||
|
||||
Reference in new issue
Block a user