imadtbro
11/12/2024, 4:57 PMPossibly unhandled rejection: The user object is invalid, the remainingAuthSeconds is required.
I'm pretty sure it has to do with how I'm using the cookie authentication. Is there any way to fix this? Or is there anyway to better setup the cookie authentication than how I am doing it currently?
If anymore information is needed, please let me know and I can provide it!
Thank you!
https://cdn.discordapp.com/attachments/1305939609548492870/1305939609758470214/image.png?ex=6734da8a&is=6733890a&hm=43e0a7c12f81eed0e65cab3da0dae71e03d4f720cf3d7ce571719b10f29483df&
https://cdn.discordapp.com/attachments/1305939609548492870/1305939610261520484/image.png?ex=6734da8a&is=6733890a&hm=6d2816d406f193c1c2c9ddd794c9db2d00e3fb234e5f47c8e2277e7012ea2c26&
https://cdn.discordapp.com/attachments/1305939609548492870/1305939610530086973/image.png?ex=6734da8a&is=6733890a&hm=faea64d792ab91d041149de01e37786e136a4956126bee4d6aba6b094ba5e68f&
https://cdn.discordapp.com/attachments/1305939609548492870/1305939610786074714/image.png?ex=6734da8a&is=6733890a&hm=7b63405b97a65717deb380f2c7c98522505d7057ab4b134a10be884c7fc6fc86&D_Inventor
11/14/2024, 6:51 AMu.AppBuilder.UseAuthentication()
. Umbraco does that automatically for you. This could potentially be why you can't login anymore in the backoffice
- If you have your own data source for user accounts, then you likely don't want to use Umbraco's member logic, as that is built upon Umbraco's built-in members.
- Umbraco uses some of the default constants. I don't know if CookieAuthenticationDefaults.AuthenticationScheme
is one of them, but you likely want to use a unique scheme for your own cookies. Notice that this constant doesn't really do any magic. It's a magic string that identifies your cookie authentication instance. You can exchange it for any other string, as long as you use the same string everywhere.
- I would not use AddMemberLogin
if you don't use Umbraco's built-in members. Just do it the plain ASP.NET way.imadtbro
11/14/2024, 11:10 PMNeelK
01/22/2025, 4:43 PMD_Inventor
01/23/2025, 11:18 AMUseAuthentication
or UseAuthorization
, because Umbraco already does that for you.
If you find that HttpContext.User
does not contain an authenticated user, then make sure that you have your controller or action decorated with an Authorize
attribute. Without the attribute, ASP.NET won't populate the user property in your http context.NeelK
01/28/2025, 11:32 AMD_Inventor
01/28/2025, 1:47 PM