-
Notifications
You must be signed in to change notification settings - Fork 7
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
Appearance customization #12
Comments
Hello. I am new to Bolt CMS too, made a simple form in twig and styled it. Redirect path can be added like this:
But it only seems to be working for login form. Can't figure out why it's not working for registration form. Neither can I figure out how to display errors if the registration/login fail. Form does not seem to provide any data on this. |
I copied class LoginFormExtension from extension folder into App\Extension\users\Twig (maybe better would be extend) Regarding error messages, I haven't fixed them yet, but I noticed, then when you, say, send wrong creds in FE form and in same session (same browser window) open BE login form (/bolt/login), it shows error message for FE form, so you can try to peek into it's code to find out how's it retrieved. And if you succed, please let me know, for it waits for me too... |
Hi @labrador-gibraltar and @andriusign , Just to confirm what @andriusign already mentioned, indeed you can build a custom form if you would like to do further custom work. You can generate a path to the
Hope this helps! Let me know if you have other questions. |
@I-Valchev, thank you!
in the end of routes.yaml |
hi @labrador-gibraltar ,
|
Thanks @I-Valchev for the mention and my apologies for the late response. @labrador-gibraltar, for my particular use case (still under active development, but you are free to test it out at https://demo.raymusumba.com), the extension does what it is supposed to, and I think it does the job well. As far as a logout route is concerned, which you will see us discussing in Issue #11, there may be no easy solution at the moment because I believe this extension is tied to the same authentication flow used for the BE, right @I-Valchev? That said, I turned to the extension's logic to handle routing based on auth status, for example, there is a route named
So practically, if you set something like I hope this makes sense? I was trying to work on a logout route for FE users primarily because I wanted to obscure the BE login URL because I always change it for all my projects for security reasons. So FE users don't get to it at all. Feel free to create an account for the project above while I still have it hosted so you can see the flow. |
PS: @labrador-gibraltar my
you need to make sure your registration form is registering users to that group for the configs to be applied. In my case, for example |
@andriusign on this issue you're facing:
If you use the registration form as mentioned above, the related settings you set in your config will work. If you really need to customize your form output, perhaps you could look at On the feedback, I think you're better off being as obscure as possible. Don't give any leads as to what input is erroneous. 9/10 time it will be feedback about wrong credentials anyway, so if you really want to give that feedback you could find a way to show something like "Invalid username/password" in a toast or something. I would argue that a password reset functionality would take higher precedence. Additionally, you could opt for client-side input validation as well, as I've done with the example at https://demo.raymusumba.com/page/register |
Hello!
I'm trying to customize HTML returned by login_form() function. This needs some attributes inside tags, like class, id etc.
But there are only label parameters available, as long as for login_form_username, login_form_password functions made for customization.
Of course, I can write my own html/twig as I want, but how do I retrieve postUrl and redirectField that are used in src/Twig/LoginFormExtension.php ?
Sorry if this is a dumb question, I'm new to BoltCMS. Should I rewrite named class or there is more elegant way?
The text was updated successfully, but these errors were encountered: