heloo
heloo
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
thanks for trying
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
it was the clients fault
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
FIXED
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
but when i deploy it to a remote server the refresh tokens are null
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
when i send try with my local dotnet webapi server the token gets sent
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
it works
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
and i tested this on my local server
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
var res = new ServiceResponse<string>(); var Token = _httpContext.HttpContext?.Request.Cookies["refreshToken"]; if (Token is null) { res.StatusCode = 400; res.ErrorMessage = "No RefreshToken!"; return res; }
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
but
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
the request gets sent
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
but it wont send
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
ive manually written the cookie
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
try { const response = await fetch('https://url/api/Auth?Id=5', { method:"GET", credentials:'include', });
// Handle response const data = await response.json() setToken(data.data); } catch (error) { // Handle error console.error('Error:', error); // You may want to display an error message to the user } };
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
this is hell
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
must be a client issue then
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
also heres the response header
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Date: Sun, 05 May 2024 17:40:02 GMT Server: Kestrel Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: http://localhost:3000 Set-Cookie: refreshToken=iqK2hLxa%2FZLpUODCk7mFfVDVMnx%2BWNJS7amsLKr1NbVlgKVwseXHuDwu92N3QCxcT0LMDbmwe7e5%2BpW2zrah2g%3D%3D; expires=Tue, 04 Jun 2024 17:40:02 GMT; path=/; samesite=strict; httponly Transfer-Encoding: chunked Vary: Origin
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
even clicked on allow on third party cookies in settings
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
CookieOptions cookOpt = new() { HttpOnly = true, Expires = refresh.ExpiresAt, SameSite = Microsoft.AspNetCore.Http.SameSiteMode.Strict, }; _httpContext.HttpContext?.Response.Cookies.Append("refreshToken", refresh.Token, cookOpt);
27 replies
CC#
Created by heloo on 5/5/2024 in #help
Cookies help Dotnet webapi
removed the secure option tried http didnt work
27 replies