Skip to content

Commit

Permalink
fix(fe2): email verification notice improvements (#2212)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabis94 authored Apr 17, 2024
1 parent 4e9c9eb commit 5dc2853
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 127 deletions.
119 changes: 0 additions & 119 deletions packages/frontend-2/components/auth/VerificationReminder.vue

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
</CommonTextLink> -->
</div>
</div>
<div v-else-if="noticeLoading">
<CommonLoadingIcon size="sm" class="my-2 mx-auto" />
</div>
<div v-else />
</template>
<script setup lang="ts">
import { graphql } from '~~/lib/common/generated/gql'
Expand Down Expand Up @@ -49,7 +53,7 @@ const requestVerificationMutation = graphql(`
const apollo = useApolloClient().client
const { triggerNotification } = useGlobalToast()
const { result } = useQuery(reminderStateQuery)
const { result, loading: noticeLoading } = useQuery(reminderStateQuery)
const user = computed(() => result.value?.activeUser || null)
const dismissed = ref(false)
Expand Down
8 changes: 1 addition & 7 deletions packages/frontend-2/server/routes/web-api/cookie-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ const isValidTempCookieValue = (cookie: unknown): cookie is TempCookieValue => {

export default defineEventHandler((event) => {
const cookies = parseCookies(event)
const {
public: { baseUrl }
} = useRuntimeConfig()
const domain = new URL(baseUrl).hostname

for (const [key, val] of Object.entries(cookies)) {
if (key.startsWith('tmp-')) {
// Try reading in cookie settings
Expand Down Expand Up @@ -45,8 +40,7 @@ export default defineEventHandler((event) => {
// Create new cookie with the correct settings
setCookie(event, cookieName, cookieValue, {
maxAge: tempCookieVal.maxAge,
expires: tempCookieVal.expires ? new Date(tempCookieVal.expires) : undefined,
domain
expires: tempCookieVal.expires ? new Date(tempCookieVal.expires) : undefined
})
deleteCookie(event, key)
}
Expand Down

0 comments on commit 5dc2853

Please sign in to comment.