mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
feat: add X-App-Source header to Nova + remove notify checkbox (#926)
Co-authored-by: Ishaan Gupta <ishaankone@gmail.com> Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com> Co-authored-by: Akhilesh Arora <akhildawra@gmail.com>
This commit is contained in:
parent
bb50685ff4
commit
6437814f25
6 changed files with 11 additions and 25 deletions
|
|
@ -54,6 +54,7 @@ export default function RootLayout({
|
|||
"https://api.supermemory.ai"
|
||||
}
|
||||
includeCredentials={true}
|
||||
headers={{ "X-App-Source": "nova" }}
|
||||
>
|
||||
<QueryProvider>
|
||||
<AuthProvider>
|
||||
|
|
|
|||
|
|
@ -192,7 +192,6 @@ export default function Account() {
|
|||
const autumn = useCustomer()
|
||||
const [isUpgrading, setIsUpgrading] = useState(false)
|
||||
const [emailConfirm, setEmailConfirm] = useState("")
|
||||
const [notifyWhenDeleted, setNotifyWhenDeleted] = useState(false)
|
||||
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false)
|
||||
const [isClosingAccount, setIsClosingAccount] = useState(false)
|
||||
const [switchingOrgId, setSwitchingOrgId] = useState<string | null>(null)
|
||||
|
|
@ -287,7 +286,6 @@ export default function Account() {
|
|||
try {
|
||||
await deleteUserAccount.mutateAsync({
|
||||
confirmation: user.email,
|
||||
notifyOnComplete: notifyWhenDeleted,
|
||||
})
|
||||
clearActiveOrg()
|
||||
try {
|
||||
|
|
@ -298,7 +296,6 @@ export default function Account() {
|
|||
}
|
||||
setIsDeleteDialogOpen(false)
|
||||
setEmailConfirm("")
|
||||
setNotifyWhenDeleted(false)
|
||||
window.location.assign("/login/new")
|
||||
} catch (e) {
|
||||
const msg = e instanceof Error ? e.message : "Something went wrong"
|
||||
|
|
@ -701,7 +698,6 @@ export default function Account() {
|
|||
setIsDeleteDialogOpen(open)
|
||||
if (!open) {
|
||||
setEmailConfirm("")
|
||||
setNotifyWhenDeleted(false)
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
|
@ -909,26 +905,6 @@ export default function Account() {
|
|||
/>
|
||||
<div className="absolute inset-0 pointer-events-none rounded-[inherit] shadow-[inset_0px_0px_0px_1px_rgba(43,49,67,0.08),inset_0px_1px_1px_rgba(0,0,0,0.08),inset_0px_2px_4px_rgba(0,0,0,0.02)]" />
|
||||
</div>
|
||||
<label
|
||||
className={cn(
|
||||
"flex cursor-pointer items-start gap-3 pl-2 pt-2",
|
||||
dmSans125ClassName(),
|
||||
"text-[13px] tracking-[-0.13px] text-[#A3A3A3]",
|
||||
)}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={notifyWhenDeleted}
|
||||
onChange={(e) =>
|
||||
setNotifyWhenDeleted(e.target.checked)
|
||||
}
|
||||
className="mt-0.5 size-4 shrink-0 rounded border-onboarding bg-[#14161A]"
|
||||
/>
|
||||
<span>
|
||||
Email me when my account and data have been fully
|
||||
removed.
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export function useAccountMemberships() {
|
|||
queryFn: async () => {
|
||||
const res = await fetch(`${API_BASE}/v3/auth/account/memberships`, {
|
||||
credentials: "include",
|
||||
headers: { "X-App-Source": "nova" },
|
||||
})
|
||||
if (!res.ok) {
|
||||
throw new Error("Failed to load organizations")
|
||||
|
|
@ -41,6 +42,7 @@ export function useLeaveNonOwnerMemberships() {
|
|||
{
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
headers: { "X-App-Source": "nova" },
|
||||
},
|
||||
)
|
||||
if (!res.ok) {
|
||||
|
|
@ -73,7 +75,7 @@ export function useDeleteUserAccount() {
|
|||
const res = await fetch(`${API_BASE}/v3/auth/account/delete`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
headers: { "Content-Type": "application/json", "X-App-Source": "nova" },
|
||||
body: JSON.stringify({
|
||||
confirmation,
|
||||
...(notifyOnComplete === true ? { notifyOnComplete: true } : {}),
|
||||
|
|
|
|||
BIN
apps/web/public/images/plugins/cursor.png
Normal file
BIN
apps/web/public/images/plugins/cursor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
|
|
@ -253,6 +253,12 @@ export const apiSchema = createSchema({
|
|||
export const $fetch = createFetch({
|
||||
baseURL: `${process.env.NEXT_PUBLIC_BACKEND_URL ?? "https://api.supermemory.ai"}/v3`,
|
||||
credentials: "include",
|
||||
headers: { "X-App-Source": "nova" },
|
||||
onRequest: (context: { headers: Headers }) => {
|
||||
if (!context.headers.has("X-App-Source")) {
|
||||
context.headers.set("X-App-Source", "nova")
|
||||
}
|
||||
},
|
||||
retry: {
|
||||
attempts: 3,
|
||||
delay: 100,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ export const authClient = createAuthClient({
|
|||
baseURL: process.env.NEXT_PUBLIC_BACKEND_URL ?? "https://api.supermemory.ai",
|
||||
fetchOptions: {
|
||||
credentials: "include",
|
||||
headers: { "X-App-Source": "nova" },
|
||||
},
|
||||
plugins: [
|
||||
usernameClient(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue