#Remix-auth form strategy

1 messages · Page 1 of 1 (latest)

wheat comet
#

Hi everybody,

I was using remix-auth remix-auth-form as strategy to authenticate users.
I have used AuthorizationError to throw errors and grab them later from the session in the loader.

The problem is that I thought that the error should disappear from the session after getting it (because it uses session.flash), so if I hard-reload the page the error should disappear from the UI as well, but it persists.

They only way, I was able to make it was committing the session again in the loader, but in the docs I couldn't find that this might be necessary.

I was wondering if this was happening just because I was using a pathless layout route

I created a basic repository with a dummy authentication to demonstrate the issue:
https://github.com/juanmaperez/remix-auth-test

any thoughts?

GitHub

Contribute to juanmaperez/remix-auth-test development by creating an account on GitHub.

torpid tide
#

When you read a key set with session.flash you need to commit the session to remove it, this is how session.flash works in Remix

wheat comet
#

ok! so it's a requirement to commit to remove it. It wasn't clear in the remix-auth-form docs, in the example it only returns the error in the loader without committing the session

torpid tide
#

it's not on the remix-auth-form docs because it's already on the Remix docs

wheat comet
#

yeah, that's true! Thanks very much for confirming. I was afraid I was doing things wrong or that the problem was coming from somewhere else