feat(frontend): use __Host prefix for token cookie
This commit is contained in:
parent
646c2694e1
commit
2b8e4c3e8d
8 changed files with 108 additions and 101 deletions
|
@ -1,6 +1,6 @@
|
|||
import { ActionFunction } from "@remix-run/node";
|
||||
import { UserSettings } from "~/lib/api/user";
|
||||
import serverRequest, { getCookie, writeCookie } from "~/lib/request.server";
|
||||
import serverRequest, { getToken, writeCookie } from "~/lib/request.server";
|
||||
|
||||
// Handles theme switching
|
||||
// Remix itself handles redirecting back to the original page after the setting is set
|
||||
|
@ -15,7 +15,7 @@ export const action: ActionFunction = async ({ request }) => {
|
|||
const body = await request.formData();
|
||||
const theme = (body.get("theme") as string | null) || "auto";
|
||||
|
||||
const token = getCookie(request, "pronounscc-token");
|
||||
const token = getToken(request);
|
||||
if (token) {
|
||||
await serverRequest<UserSettings>("PATCH", "/users/@me/settings", {
|
||||
token,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue