mikker / passwordless

🗝 Authentication for your Rails app without the icky-ness of passwords
MIT License
1.25k stars 86 forks source link

[DRAFT] readme proofreading #189

Closed yshmarov closed 5 months ago

yshmarov commented 7 months ago
-    redirect_to root_path, flash: { error: 'You are not worthy!' }
+    redirect_to root_path, error: 'You are not worthy!'

might be also worth adding this in the readme:

    <% if current_user %>
      <%= current_user.email %>
      <%= button_to 'Sign out', users_sign_out_path, method: :delete, form: { data: { turbo_confirm: 'Log out?' } } %>
    <% else %>
      <%= link_to 'Sign in', users_sign_in_path %>
    <% end %>
mikker commented 5 months ago

Thank you. Closing this and updating the README manually

luiscobot commented 5 months ago

maybe it is worth mentioning that we need to add

add_flash_types :error

in application controller

mikker commented 5 months ago

Is this not already configured in Rails? I've never seen this before

luiscobot commented 5 months ago

No, Rails only includes :alert and :notice out of the box.

If we want other types, we need to add it with add_flash_types

https://edgeapi.rubyonrails.org/classes/ActionController/Flash/ClassMethods.html#method-i-add_flash_types

mikker commented 5 months ago

Ha! TIL.

I suggest we use :alert instead then?

luiscobot commented 5 months ago

Yeah, it is more simple to use :alert