Compare commits
5 Commits
refactor/w
...
fix/cookie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
156c341a81 | ||
|
|
81e090bbba | ||
|
|
87ba02053b | ||
|
|
fb08147c66 | ||
|
|
d129676cd6 |
@@ -63,7 +63,7 @@ export const authCookieHandler = (
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!redirect) {
|
if (!redirect) {
|
||||||
res.status(HttpStatus.OK).send();
|
return res.status(HttpStatus.OK).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
// check to see if redirectUrl is a whitelisted url
|
// check to see if redirectUrl is a whitelisted url
|
||||||
@@ -72,7 +72,7 @@ export const authCookieHandler = (
|
|||||||
// if it is not redirect by default to REDIRECT_URL
|
// if it is not redirect by default to REDIRECT_URL
|
||||||
redirectUrl = process.env.REDIRECT_URL;
|
redirectUrl = process.env.REDIRECT_URL;
|
||||||
|
|
||||||
res.status(HttpStatus.OK).redirect(redirectUrl);
|
return res.status(HttpStatus.OK).redirect(redirectUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ declare module '@vue/runtime-core' {
|
|||||||
HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
|
HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
|
||||||
HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink']
|
HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink']
|
||||||
HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
|
HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
|
||||||
|
HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']
|
||||||
HoppSmartProgressRing: typeof import('@hoppscotch/ui')['HoppSmartProgressRing']
|
HoppSmartProgressRing: typeof import('@hoppscotch/ui')['HoppSmartProgressRing']
|
||||||
HoppSmartRadioGroup: typeof import('@hoppscotch/ui')['HoppSmartRadioGroup']
|
HoppSmartRadioGroup: typeof import('@hoppscotch/ui')['HoppSmartRadioGroup']
|
||||||
HoppSmartSlideOver: typeof import('@hoppscotch/ui')['HoppSmartSlideOver']
|
HoppSmartSlideOver: typeof import('@hoppscotch/ui')['HoppSmartSlideOver']
|
||||||
@@ -164,6 +165,7 @@ declare module '@vue/runtime-core' {
|
|||||||
SmartItem: typeof import('./../../hoppscotch-ui/src/components/smart/Item.vue')['default']
|
SmartItem: typeof import('./../../hoppscotch-ui/src/components/smart/Item.vue')['default']
|
||||||
SmartLink: typeof import('./../../hoppscotch-ui/src/components/smart/Link.vue')['default']
|
SmartLink: typeof import('./../../hoppscotch-ui/src/components/smart/Link.vue')['default']
|
||||||
SmartModal: typeof import('./../../hoppscotch-ui/src/components/smart/Modal.vue')['default']
|
SmartModal: typeof import('./../../hoppscotch-ui/src/components/smart/Modal.vue')['default']
|
||||||
|
SmartPicture: typeof import('./../../hoppscotch-ui/src/components/smart/Picture.vue')['default']
|
||||||
SmartProgressRing: typeof import('./../../hoppscotch-ui/src/components/smart/ProgressRing.vue')['default']
|
SmartProgressRing: typeof import('./../../hoppscotch-ui/src/components/smart/ProgressRing.vue')['default']
|
||||||
SmartRadio: typeof import('./../../hoppscotch-ui/src/components/smart/Radio.vue')['default']
|
SmartRadio: typeof import('./../../hoppscotch-ui/src/components/smart/Radio.vue')['default']
|
||||||
SmartRadioGroup: typeof import('./../../hoppscotch-ui/src/components/smart/RadioGroup.vue')['default']
|
SmartRadioGroup: typeof import('./../../hoppscotch-ui/src/components/smart/RadioGroup.vue')['default']
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
theme="popover"
|
theme="popover"
|
||||||
:on-shown="() => tippyActions.focus()"
|
:on-shown="() => tippyActions.focus()"
|
||||||
>
|
>
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-if="currentUser.photoURL"
|
v-if="currentUser.photoURL"
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
theme: 'tooltip',
|
theme: 'tooltip',
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
network.isOnline ? 'bg-green-500' : 'bg-red-500'
|
network.isOnline ? 'bg-green-500' : 'bg-red-500'
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-else
|
v-else
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="
|
:title="
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
<template>
|
|
||||||
<button
|
|
||||||
tabindex="0"
|
|
||||||
class="relative flex items-center justify-center overflow-visible cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primaryDark"
|
|
||||||
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
v-if="url"
|
|
||||||
class="absolute object-cover object-center transition bg-primaryDark"
|
|
||||||
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
|
|
||||||
:src="url"
|
|
||||||
:alt="alt"
|
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="absolute flex items-center justify-center object-cover object-center transition bg-primaryDark text-accentContrast"
|
|
||||||
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
|
|
||||||
:style="`background-color: ${initial ? toHex(initial) : '#480000'}`"
|
|
||||||
>
|
|
||||||
<template v-if="initial && initial.charAt(0).toUpperCase()">
|
|
||||||
{{ initial.charAt(0).toUpperCase() }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<icon-lucide-user v-else></icon-lucide-user>
|
|
||||||
</div>
|
|
||||||
<span
|
|
||||||
v-if="indicator"
|
|
||||||
class="border-primary border-2 h-2.5 -top-0.5 -right-0.5 w-2.5 absolute"
|
|
||||||
:class="[`rounded-${rounded}`, indicatorStyles]"
|
|
||||||
></span>
|
|
||||||
<!-- w-5 h-5 rounded-lg -->
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { defineComponent, PropType } from "vue"
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
props: {
|
|
||||||
url: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
alt: {
|
|
||||||
type: String,
|
|
||||||
default: "Profile picture",
|
|
||||||
},
|
|
||||||
indicator: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
indicatorStyles: {
|
|
||||||
type: String,
|
|
||||||
default: "bg-green-500",
|
|
||||||
},
|
|
||||||
rounded: {
|
|
||||||
type: String,
|
|
||||||
default: "full",
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: String,
|
|
||||||
default: "5",
|
|
||||||
},
|
|
||||||
initial: {
|
|
||||||
type: String as PropType<string | undefined | null>,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toHex(initial: string) {
|
|
||||||
let hash = 0
|
|
||||||
if (initial.length === 0) return hash
|
|
||||||
for (let i = 0; i < initial.length; i++) {
|
|
||||||
hash = initial.charCodeAt(i) + ((hash << 5) - hash)
|
|
||||||
hash = hash & hash
|
|
||||||
}
|
|
||||||
let color = "#"
|
|
||||||
for (let i = 0; i < 3; i++) {
|
|
||||||
const value = (hash >> (i * 8)) & 255
|
|
||||||
color += `00${value.toString(16)}`.slice(-2)
|
|
||||||
}
|
|
||||||
return color
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
:key="`member-${index}`"
|
:key="`member-${index}`"
|
||||||
class="inline-flex"
|
class="inline-flex"
|
||||||
>
|
>
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-if="member.user.photoURL"
|
v-if="member.user.photoURL"
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:url="member.user.photoURL"
|
:url="member.user.photoURL"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
class="ring-primary ring-2"
|
class="ring-primary ring-2"
|
||||||
@click="handleClick()"
|
@click="handleClick()"
|
||||||
/>
|
/>
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-else
|
v-else
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="getUserName(member)"
|
:title="getUserName(member)"
|
||||||
|
|||||||
@@ -24,7 +24,10 @@
|
|||||||
>
|
>
|
||||||
<Pane class="flex flex-1 !overflow-auto">
|
<Pane class="flex flex-1 !overflow-auto">
|
||||||
<main class="flex flex-1 w-full" role="main">
|
<main class="flex flex-1 w-full" role="main">
|
||||||
<RouterView v-slot="{ Component }" class="flex flex-1">
|
<RouterView
|
||||||
|
v-slot="{ Component }"
|
||||||
|
class="flex flex-1 min-w-0"
|
||||||
|
>
|
||||||
<Transition name="fade" mode="out-in" appear>
|
<Transition name="fade" mode="out-in" appear>
|
||||||
<component :is="Component" />
|
<component :is="Component" />
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
></div>
|
></div>
|
||||||
<div class="flex flex-col justify-between px-4 space-y-8 md:flex-row">
|
<div class="flex flex-col justify-between px-4 space-y-8 md:flex-row">
|
||||||
<div class="flex items-end">
|
<div class="flex items-end">
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-if="currentUser.photoURL"
|
v-if="currentUser.photoURL"
|
||||||
:url="currentUser.photoURL"
|
:url="currentUser.photoURL"
|
||||||
:alt="
|
:alt="
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
size="16"
|
size="16"
|
||||||
rounded="lg"
|
rounded="lg"
|
||||||
/>
|
/>
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-else
|
v-else
|
||||||
:initial="currentUser.displayName || currentUser.email"
|
:initial="currentUser.displayName || currentUser.email"
|
||||||
rounded="lg"
|
rounded="lg"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
arrow
|
arrow
|
||||||
:on-shown="() => tippyActions!.focus()"
|
:on-shown="() => tippyActions!.focus()"
|
||||||
>
|
>
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-if="currentUser.photoURL"
|
v-if="currentUser.photoURL"
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
theme: 'tooltip',
|
theme: 'tooltip',
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
:alt="currentUser.displayName ?? 'No Name'"
|
:alt="currentUser.displayName ?? 'No Name'"
|
||||||
:title="currentUser.displayName ?? currentUser.email ?? 'No Name'"
|
:title="currentUser.displayName ?? currentUser.email ?? 'No Name'"
|
||||||
/>
|
/>
|
||||||
<ProfilePicture
|
<HoppSmartPicture
|
||||||
v-else
|
v-else
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="currentUser.displayName ?? currentUser.email ?? 'No Name'"
|
:title="currentUser.displayName ?? currentUser.email ?? 'No Name'"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const isAdmin = () => {
|
|||||||
return user ? user.isAdmin : false;
|
return user ? user.isAdmin : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const GUEST_ROUTES = ['index', 'magic-link'];
|
const GUEST_ROUTES = ['index', 'enter'];
|
||||||
|
|
||||||
const isGuestRoute = (to: unknown) => GUEST_ROUTES.includes(to as string);
|
const isGuestRoute = (to: unknown) => GUEST_ROUTES.includes(to as string);
|
||||||
|
|
||||||
|
|||||||
@@ -33,55 +33,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineComponent, PropType } from 'vue';
|
withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
url: string
|
||||||
|
alt: string
|
||||||
|
indicator: boolean
|
||||||
|
indicatorStyles: string
|
||||||
|
rounded: string
|
||||||
|
size: string
|
||||||
|
initial: string | undefined | null
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
url: "",
|
||||||
|
alt: "Profile picture",
|
||||||
|
indicator: false,
|
||||||
|
indicatorStyles: "bg-green-500",
|
||||||
|
rounded: "full",
|
||||||
|
size: "5",
|
||||||
|
initial: "",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
export default defineComponent({
|
const toHex = (initial: string) => {
|
||||||
props: {
|
let hash = 0
|
||||||
url: {
|
if (initial.length === 0) return hash
|
||||||
type: String,
|
for (let i = 0; i < initial.length; i++) {
|
||||||
default: '',
|
hash = initial.charCodeAt(i) + ((hash << 5) - hash)
|
||||||
},
|
hash = hash & hash
|
||||||
alt: {
|
}
|
||||||
type: String,
|
let color = "#"
|
||||||
default: 'Profile picture',
|
for (let i = 0; i < 3; i++) {
|
||||||
},
|
const value = (hash >> (i * 8)) & 255
|
||||||
indicator: {
|
color += `00${value.toString(16)}`.slice(-2)
|
||||||
type: Boolean,
|
}
|
||||||
default: false,
|
return color
|
||||||
},
|
}
|
||||||
indicatorStyles: {
|
|
||||||
type: String,
|
|
||||||
default: 'bg-green-500',
|
|
||||||
},
|
|
||||||
rounded: {
|
|
||||||
type: String,
|
|
||||||
default: 'full',
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: String,
|
|
||||||
default: '5',
|
|
||||||
},
|
|
||||||
initial: {
|
|
||||||
type: String as PropType<string | undefined | null>,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toHex(initial: string) {
|
|
||||||
let hash = 0;
|
|
||||||
if (initial.length === 0) return hash;
|
|
||||||
for (let i = 0; i < initial.length; i++) {
|
|
||||||
hash = initial.charCodeAt(i) + ((hash << 5) - hash);
|
|
||||||
hash = hash & hash;
|
|
||||||
}
|
|
||||||
let color = '#';
|
|
||||||
for (let i = 0; i < 3; i++) {
|
|
||||||
const value = (hash >> (i * 8)) & 255;
|
|
||||||
color += `00${value.toString(16)}`.slice(-2);
|
|
||||||
}
|
|
||||||
return color;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@@ -18,3 +18,4 @@ export { default as HoppSmartTabs } from "./Tabs.vue"
|
|||||||
export { default as HoppSmartToggle } from "./Toggle.vue"
|
export { default as HoppSmartToggle } from "./Toggle.vue"
|
||||||
export { default as HoppSmartWindow } from "./Window.vue"
|
export { default as HoppSmartWindow } from "./Window.vue"
|
||||||
export { default as HoppSmartWindows } from "./Windows.vue"
|
export { default as HoppSmartWindows } from "./Windows.vue"
|
||||||
|
export { default as HoppSmartPicture } from "./Picture.vue"
|
||||||
|
|||||||
Reference in New Issue
Block a user