You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When hitting the above confirmation url I could see "ConfirmationsController#show" method could called twice times. On an first time call it says confirmation gets success and on the second time call it throws an error as "[{:error=>:already_confirmed}]}>" then this leads to routing error,
Logs:
_Started GET "/api/v1/auth/confirmation?config=default&confirmation_token=GHz9m52xVeQJJLFLJnWw&redirect_url=%2F" for ::1 at 2019-05-04 14:45:46 +0530_
Processing by DeviseTokenAuth::ConfirmationsController#show as HTML
Parameters: {"config"=>"default", "confirmation_token"=>"GHz9m52xVeQJJLFLJnWw", "redirect_url"=>"/"}
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["confirmation_token", "GHz9m52xVeQJJLFLJnWw"], ["LIMIT", 1]]
↳ /home/user/.rvm/gems/ruby-2.6.2@church/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
(0.3ms) BEGIN
↳ /home/user/.rvm/gems/ruby-2.6.2@church/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
User Update (0.7ms) UPDATE "users" SET "confirmed_at" = $1, "updated_at" = $2 WHERE "users"."id" = $3 [["confirmed_at", "2019-05-04 09:15:46.325684"], ["updated_at", "2019-05-04 09:15:46.326717"], ["id", 26]]
↳ /home/user/.rvm/gems/ruby-2.6.2@church/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
(1.4ms) COMMIT
↳ /home/user/.rvm/gems/ruby-2.6.2@church/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
Redirected to http://localhost:3000:///?account_confirmation_success=true
Completed 302 Found in 21ms (ActiveRecord: 3.1ms)
_Started GET "/api/v1/auth/confirmation?config=default&confirmation_token=GHz9m52xVeQJJLFLJnWw&redirect_url=%2F" for ::1 at 2019-05-04 14:45:46 +0530_
Processing by DeviseTokenAuth::ConfirmationsController#show as HTML
Parameters: {"config"=>"default", "confirmation_token"=>"GHz9m52xVeQJJLFLJnWw", "redirect_url"=>"/"}
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["confirmation_token", "GHz9m52xVeQJJLFLJnWw"], ["LIMIT", 1]]
↳ /home/user/.rvm/gems/ruby-2.6.2@church/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
Completed 404 Not Found in 6ms (ActiveRecord: 0.7ms)
{
"success": false,
"errors": [
"A confirmation email was sent to your account at '[email protected]'. You must follow the instructions in the email before your account can be activated"
]
}
Questions,
Why "ConfirmationsController#show" called twice a time when hitting confirmation url?
Why the user has not able to sign_in even if confirmation gets success?
What I missed here?
The text was updated successfully, but these errors were encountered:
I need help with this too. I am using mailcatcher to catch emails in development env. What I realized is, when I set a default_confirm_success_url in the devise_token_auth.rb config file, I get this behaviour explained by @nihp , but when I comment that global default config default_confirm_success_url and pass confirm_success_url to the sign_up route, I get the right behaviour, it creates the account, sends the email and mailcatcher catches it and when clicked it does the redirect to the URL specified.
Why the weird behaviour when setting as default config for confirm_success_url in the config file?
These are the version specifications used in my application,
During user registration with this endpoint,
http://localhost:3000/api/v1/auth/
I got the confirmation url as follows,
http://localhost:3000/api/v1/auth/confirmation?config=default&confirmation_token=GHz9m52xVeQJJLFLJnWw&redirect_url=%2F
When hitting the above confirmation url I could see "ConfirmationsController#show" method could called twice times. On an first time call it says confirmation gets success and on the second time call it throws an error as "[{:error=>:already_confirmed}]}>" then this leads to routing error,
Logs:
When sign_in with this url,
http://localhost:3000/api/v1/auth/sign_in
I got the response as,
Questions,
What I missed here?
The text was updated successfully, but these errors were encountered: