From 1964c0ae70740e55ddcf27da518efccd1089e41d Mon Sep 17 00:00:00 2001 From: chloe Date: Thu, 19 Mar 2026 21:08:44 +0000 Subject: [PATCH] update images --- Seasoned.Backend/Program.cs | 5 +++-- Seasoned.Frontend/app/pages/gallery.vue | 3 ++- Seasoned.Frontend/app/pages/login.vue | 10 ++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Seasoned.Backend/Program.cs b/Seasoned.Backend/Program.cs index 5797f6e..046a90d 100644 --- a/Seasoned.Backend/Program.cs +++ b/Seasoned.Backend/Program.cs @@ -27,9 +27,10 @@ builder.Services.ConfigureApplicationCookie(options => { options.Cookie.Name = "Seasoned.Session"; options.Cookie.HttpOnly = true; - options.Cookie.SameSite = SameSiteMode.None; + options.Cookie.SameSite = SameSiteMode.Lax; options.Cookie.SecurePolicy = CookieSecurePolicy.Always; options.ExpireTimeSpan = TimeSpan.FromMinutes(30); + options.Cookie.MaxAge = options.ExpireTimeSpan; options.SlidingExpiration = true; options.Events.OnRedirectToLogin = context => { @@ -51,7 +52,7 @@ builder.Services.AddCors(options => { options.AddPolicy("SeasonedOriginPolicy", policy => { - policy.WithOrigins("https://seasoned.ddns.net") + policy.WithOrigins("https://seasoned.ddns.net", "https://www.seasoned.ddns.net") .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials(); diff --git a/Seasoned.Frontend/app/pages/gallery.vue b/Seasoned.Frontend/app/pages/gallery.vue index 471c990..9c0139a 100644 --- a/Seasoned.Frontend/app/pages/gallery.vue +++ b/Seasoned.Frontend/app/pages/gallery.vue @@ -406,7 +406,8 @@ const saveChanges = async () => { const index = recipes.value.findIndex(r => r.id === selectedRecipe.value.id); if (index !== -1) { - recipes.value[index] = { ...recipes.value[index], ...payload }; + const updatedRecipe = { ...recipes.value[index], ...payload }; + recipes.value.splice(index, 1, updatedRecipe); } closeDetails(); diff --git a/Seasoned.Frontend/app/pages/login.vue b/Seasoned.Frontend/app/pages/login.vue index d7e28da..6c811ef 100644 --- a/Seasoned.Frontend/app/pages/login.vue +++ b/Seasoned.Frontend/app/pages/login.vue @@ -145,16 +145,16 @@ const handleAuth = async () => { authLoading.value = true const endpoint = isLogin.value ? 'api/auth/login' : 'api/auth/register' - const url = isLogin.value - ? `${config.public.apiBase}${endpoint}?useCookies=true&useSessionCookies=false` - : `${config.public.apiBase}${endpoint}` + const url = `${config.public.apiBase}${endpoint}` try { const response = await $fetch(url, { method: 'POST', body: { email: email.value, - password: password.value + password: password.value, + useCookies: true, + useSessionCookies: false }, credentials: 'include' }) @@ -162,6 +162,7 @@ const handleAuth = async () => { if (isLogin.value) { isLoggedIn.value = true navigateTo('/') + } else { isLogin.value = true authLoading.value = false @@ -170,6 +171,7 @@ const handleAuth = async () => { confirmPassword.value = '' } } catch (err) { + authLoading.value = false if (err.status === 401) { errorMessage.value = "Invalid email or password. Please try again."