Comments (7)
Something like this...
# registrations_controller.rb
include Passwordless::ControllerHelpers
def create
user = User.new(email: params[:email])
if user.save
pwless_session = build_passwordless_session(user)
pwless_session.save!
YourOwnRegistrationsMailer.signup(token: pwless_session.token).deliver_now
# ... redirect back or whatever
end
end
from passwordless.
Did I make myself clear? Let me explain more.
I would like to make the flow, from signup to signin, like slack.
The flow like below.
- Input email for signup.
- check email and click.
Could you let me know how to do this?
I think it will work if I could use module Passwordless
properly...but I didn't.
As far as I know, this gem has 2 flows.
First: It is a pain in input twice.
- Input email for signup.
- Input email for signin.
- check email and click.
Second: It is not good for security because the email might not valid.
- Input email for signup and signin.(using
sign_in @user
)
from passwordless.
Thank you for your help!!
I did it like below!
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
pwless_session = build_passwordless_session(@user)
pwless_session.save!
RegistrationMailer.with(token: pwless_session.token, user: @user).welcome_email.deliver_now
# ... redirect back or whatever
end
end
from passwordless.
I want you to add this way at README.md if you can.
Anyway, please enjoy a cup of coffee, maybe for one year!!
from passwordless.
This is wrong
I've deleted the message due to wrong content - some local issue on my machine.
from passwordless.
I'm not sure that's right. save!
calls callbacks: https://guides.rubyonrails.org/active_record_callbacks.html#running-callbacks
from passwordless.
You are right, but this is a case for my small test project using your gem. I'll create a new issue with all information.
from passwordless.
Related Issues (20)
- Bug: Release has outdated source for router_helpers.rb HOT 6
- Feature Request: Instrumentation via `ActiveSupport::Instrumentation` HOT 1
- troubles upgrading to 1.0.0 HOT 3
- enumerate passwordless_sessions HOT 6
- app/views/passwordless/sessions/new.html.erb - label for does not match field ID HOT 1
- app/views/passwordless/sessions/show.html.erb HOT 2
- Error when registering new users HOT 3
- Bug: default_url_options[:host] is required for mailer HOT 6
- Embed redirect URL in magic link HOT 2
- error: Missing host to link to! Please provide the :host parameter HOT 1
- [DRAFT] readme proofreading HOT 6
- Add support for Turbo Native HOT 1
- autofocus in the show action view HOT 2
- current_user action controller HOT 3
- Configuring a locale in the url: /en/users/sign_in HOT 4
- Support scoped routes
- NoMethodError: undefined method `session' for nil HOT 12
- sign in via QR code 📸 HOT 3
- Add `after_session_confirm` hook after session confirmation HOT 1
- Paranoid mode still autosaves its associated authenticatable model HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passwordless.