mikker / passwordless

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

Feature: configurable redirect #69

Closed Ardnived closed 4 years ago

Ardnived commented 5 years ago

This contains the changes in PR #67, but allows further customisation, and also applied the customised redirect to all failures, instead of just token reuse. This also addresses #19 and #21

Success redirection has this priority params[:url] > reset_passwordless_redirect_location > Passwordless.success_redirect_path

In theory I've also set it up so that you can override the functions that fetch these redirects for more complicated/customisable redirection, but I haven't tested that.

All tests have been updated and pass.

mikker commented 5 years ago

This is just wonderful! Thank you for doing this 🙏

  1. I'm not sure about params[:url] – can we make up a more descriptive name? Like, destination_url or return_url or something similar.
  2. Can you add all this to the README docs? Don't have to be perfect, a first draft is fine 😅

I would be happy to merge this 💙💚💛💜❤️

Ardnived commented 5 years ago

@mikker No problem, I'll change params[:url] to params[:destination_url] and add something to the README this evening, and then update the PR.

Ardnived commented 5 years ago

@mikker I've changed the redirect query parameter to destination_path, and taken @JoeSouthan 's suggestion to make it more secure.

I updated the README, and took the liberty of making a few other changes to the README to hopefully make a bit easier to navigate.

Ardnived commented 5 years ago

@mikker Simplified the query param redirect based on @JoeSouthan 's suggestion. Let me know if there are any other changes want.

stuyam commented 4 years ago

Glad to see this pr was approved, this will really help me with #70. Let me know if there is anything I can do to help move it forward. Looking forward to it, thanks @Ardnived & @mikker! ❤️

Ardnived commented 4 years ago

I merged the suggestions. Feel free to merge the PR as far as I'm concerned.

mikker commented 4 years ago

💙💚💛💜❤️

mikker commented 4 years ago

Just released in 0.9.0 🎉

stuyam commented 4 years ago

Legendary work! This pr really takes this package to the next level! 🥇