Justin Vandenberg
WWasp
•Created by Justin Vandenberg on 4/9/2025 in #đŸ™‹questions
Disable login for a user after X number of failed attempts
I guess the ideal scenario would be some type of addition to the configuration object to specify the number of failed attempts allowed and refresh interval on the
auth
requests.
Other than that, a hook that would fire before the credentials are verified should suffice. I believe I'd just need access to the email, password, and IP to implement some form of rate limiting.13 replies
WWasp
•Created by Justin Vandenberg on 4/9/2025 in #đŸ™‹questions
Disable login for a user after X number of failed attempts
Thanks!
13 replies
WWasp
•Created by Justin Vandenberg on 4/9/2025 in #đŸ™‹questions
Disable login for a user after X number of failed attempts
If that's the case I'm experiencing a bug where the auth hooks are only firing after successful attempts. I've created a MRE here - https://github.com/justinvandenberg/wasp-onbeforelogin-hook-example/tree/main
The steps to reproduce are:
1. Clone the repo:
2. Set up database:
3. Run app:
4. Create a user
5. Verify the email using the link in the console
6. Log out (if needed)
7. Log in with incorrect credentials (you won't see
onBeforeLogin hook fired!
in the console)
8. Log in with correct credentials (you will see see onBeforeLogin hook fired!
in the console)13 replies
WWasp
•Created by Justin Vandenberg on 4/9/2025 in #đŸ™‹questions
Disable login for a user after X number of failed attempts
Following up with what I've tried up to this point:
I've tried using the auth hook
onBeforeLogin
, but that only seems to fire with a successful login attempt. Is that supposed to be how it functions?
I've also looked into setting up a custom login action, but there doesn't seem to be any documentation on that (similar to the custom signup example).13 replies
WWasp
•Created by Justin Vandenberg on 12/5/2024 in #đŸ™‹questions
How to access public assets on both server and client?
Thank you! I'll report back here with my findings for future reference.
14 replies
WWasp
•Created by Justin Vandenberg on 12/5/2024 in #đŸ™‹questions
How to access public assets on both server and client?
I'll have to see if I can get that working. I think your approach would be better if I can get that path ironed out. It looks like the paths are originating in
.wasp/out/server/bundle
in dev.
The work around I got working today was to copy those files when the Docker container is being built. I've got this in my user-defined Dockerfile
.
14 replies
WWasp
•Created by Justin Vandenberg on 12/5/2024 in #đŸ™‹questions
How to access public assets on both server and client?
I don't see the directory being compiled in the the
out
directory (it does appear in the build
directory). Correct me if I'm wrong, but that would only work when built, right?14 replies
WWasp
•Created by Justin Vandenberg on 12/5/2024 in #đŸ™‹questions
How to access public assets on both server and client?
I did try something similar to the
json
approach the bot mentioned, but the json
file doesn't seem to be complied and/or can't be resolved.14 replies