Closed aurels closed 5 years ago
Sure. Did you break the tests? 😊
Yes I did :p Let me fix them !
Not really clear to me how to run them locally.
I did :
rbenv shell 2.4.5
bundle
cd test/dummy
bin/rails db:migrate RAILS_ENV=test
and I get : ActiveRecord::StatementInvalid: SQLite3::SQLException: table "passwordless_sessions" already exists: CREATE TABLE "passwordless_sessions"
Okay, a bin/rails db:test:prepare
did it ;-)
I fixed the specs ;-)
But I realise I introduced a breaking change in the API : Passwordless.after_session_save
MUST now always have two parameters.
@aurels you could make it optional by assigning _request = nil
at the lambda. I like this change but I see it's not flexible. How about to optionally be able to pass anything to the after_session_save
method?
@kinduff Yes I can do _request = nil
.
How about to optionally be able to pass anything to the after_session_save method?
I thought about that initially but could not find a good way because it's called in SessionsController
. Any idea ?
Perhaps we could use Proc#arity
to determine how many arguments to pass? https://ruby-doc.org/core-2.2.0/Proc.html#method-i-arity
I'll try that !
What do you guys think of d4d0428fe81f1ff621592aabd550802dea5ea23b ?
LGTM 👍 Fix the rubocop warnings and I'll be happy to include this.
Mmm most of them come from code I didn't write, right ?
I’m not even sure at this point. I’ll find out and merge when I find a minute.
Merged this in #55 – thanks a bunch! 💙💚💛💜❤️
I would find it useful, what do you think ?
For example : my app is multi-domain and I'd like to know on which domain the user has initiated the login.