update images
This commit is contained in:
@@ -27,9 +27,10 @@ builder.Services.ConfigureApplicationCookie(options =>
|
|||||||
{
|
{
|
||||||
options.Cookie.Name = "Seasoned.Session";
|
options.Cookie.Name = "Seasoned.Session";
|
||||||
options.Cookie.HttpOnly = true;
|
options.Cookie.HttpOnly = true;
|
||||||
options.Cookie.SameSite = SameSiteMode.None;
|
options.Cookie.SameSite = SameSiteMode.Lax;
|
||||||
options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
|
options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
|
||||||
options.ExpireTimeSpan = TimeSpan.FromMinutes(30);
|
options.ExpireTimeSpan = TimeSpan.FromMinutes(30);
|
||||||
|
options.Cookie.MaxAge = options.ExpireTimeSpan;
|
||||||
options.SlidingExpiration = true;
|
options.SlidingExpiration = true;
|
||||||
options.Events.OnRedirectToLogin = context =>
|
options.Events.OnRedirectToLogin = context =>
|
||||||
{
|
{
|
||||||
@@ -51,7 +52,7 @@ builder.Services.AddCors(options =>
|
|||||||
{
|
{
|
||||||
options.AddPolicy("SeasonedOriginPolicy", policy =>
|
options.AddPolicy("SeasonedOriginPolicy", policy =>
|
||||||
{
|
{
|
||||||
policy.WithOrigins("https://seasoned.ddns.net")
|
policy.WithOrigins("https://seasoned.ddns.net", "https://www.seasoned.ddns.net")
|
||||||
.AllowAnyMethod()
|
.AllowAnyMethod()
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.AllowCredentials();
|
.AllowCredentials();
|
||||||
|
|||||||
@@ -406,7 +406,8 @@ const saveChanges = async () => {
|
|||||||
|
|
||||||
const index = recipes.value.findIndex(r => r.id === selectedRecipe.value.id);
|
const index = recipes.value.findIndex(r => r.id === selectedRecipe.value.id);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
recipes.value[index] = { ...recipes.value[index], ...payload };
|
const updatedRecipe = { ...recipes.value[index], ...payload };
|
||||||
|
recipes.value.splice(index, 1, updatedRecipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
closeDetails();
|
closeDetails();
|
||||||
|
|||||||
@@ -145,16 +145,16 @@ const handleAuth = async () => {
|
|||||||
authLoading.value = true
|
authLoading.value = true
|
||||||
const endpoint = isLogin.value ? 'api/auth/login' : 'api/auth/register'
|
const endpoint = isLogin.value ? 'api/auth/login' : 'api/auth/register'
|
||||||
|
|
||||||
const url = isLogin.value
|
const url = `${config.public.apiBase}${endpoint}`
|
||||||
? `${config.public.apiBase}${endpoint}?useCookies=true&useSessionCookies=false`
|
|
||||||
: `${config.public.apiBase}${endpoint}`
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await $fetch(url, {
|
const response = await $fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: {
|
body: {
|
||||||
email: email.value,
|
email: email.value,
|
||||||
password: password.value
|
password: password.value,
|
||||||
|
useCookies: true,
|
||||||
|
useSessionCookies: false
|
||||||
},
|
},
|
||||||
credentials: 'include'
|
credentials: 'include'
|
||||||
})
|
})
|
||||||
@@ -162,6 +162,7 @@ const handleAuth = async () => {
|
|||||||
if (isLogin.value) {
|
if (isLogin.value) {
|
||||||
isLoggedIn.value = true
|
isLoggedIn.value = true
|
||||||
navigateTo('/')
|
navigateTo('/')
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
isLogin.value = true
|
isLogin.value = true
|
||||||
authLoading.value = false
|
authLoading.value = false
|
||||||
@@ -170,6 +171,7 @@ const handleAuth = async () => {
|
|||||||
confirmPassword.value = ''
|
confirmPassword.value = ''
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
||||||
authLoading.value = false
|
authLoading.value = false
|
||||||
if (err.status === 401) {
|
if (err.status === 401) {
|
||||||
errorMessage.value = "Invalid email or password. Please try again."
|
errorMessage.value = "Invalid email or password. Please try again."
|
||||||
|
|||||||
Reference in New Issue
Block a user