Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session.Expired is always true #79

Closed
Dayjay opened this issue Oct 10, 2023 · 2 comments
Closed

Session.Expired is always true #79

Dayjay opened this issue Oct 10, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Dayjay
Copy link
Contributor

Dayjay commented Oct 10, 2023

Bug report

Describe the bug

Hello,

I am using Blazor WASM with Azure.

So far everything is fine except that Session.Expired() always returns true for me. I checked what Expired() actually does and recreated it when I load and save the session:

//638325369830100000 (2023-10-10​T12:16:23.009Z)
session.CreatedAt.Ticks
//3600
session.ExpiresIn
//10.10.2023 11:16:23 (ExpiredAt) - What happend here?
new DateTime(session.CreatedAt.Ticks).AddSeconds(session.ExpiresIn).ToUniversalTime())
//10.10.2023 12:19:15 (Now)
DateTime.UtcNow

The session should really just expire @ 13:16:22 UTC.

Screenshot 2023-10-10 144411

Since Expired() just checks if ExpiredAt < Now it always returns true for me. If I remove the check it works as intended.
Might be a problem with UTC time conversion? If I use DateTimeOffset(session.CreatedAt) instead of DateTime(session.CreatedAt.Ticks) I get the expected result.

Additional context

Might be a problem with just Azure? I have used Supabase before not never the auth part. Let me know if I need to provide more info.

@Dayjay Dayjay added the bug Something isn't working label Oct 10, 2023
@wiverson
Copy link
Collaborator

Makes sense to me. Want to send a PR?

@acupofjose
Copy link
Collaborator

Available in 4.2.3 - thanks @Dayjay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants