-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email confirmation link #147
Comments
Can a get a complete logs of this error ? I'll need the backtrace to help you |
I cleaned up my code a bit and now it seems redirecting without url edit (don't know why exactly). But still having 500 error. Here a gist if it's more comfortable.
Oh and also here is code that i edit so 'login' field would work, if it makes any differences: # sessions_controller, line: ~14
if field == :login
q = "(username = :field OR email = :field) AND provider='email'"
else
q = "#{field.to_s} = :field AND provider='email'"
end
# ...
@resource = resource_class.where(q, field: q_value).first Thanks for replying. |
@TomasAchmedovas - what do your routes look like? |
Rails.application.routes.draw do
root 'api#api'
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
namespace :api do
mount_devise_token_auth_for 'User', at: 'auth', controllers: {
sessions: 'devise_overrides/sessions',
}
get '/about', to: 'pages#about'
get '/contact', to: 'pages#contact'
end
# If no above routes matches then render default page
match '*path', to: 'api#api', via: :get
end
Then I manually go to
|
Also when I am signed in and refresh page, console gives same error and signs me out. |
Headers after successful sign in
Headers after page refresh:
Also cookie auth_headers disappears. |
Solved by putting route outside namespace and prefixing Current routes: Rails.application.routes.draw do
root 'api#api'
namespace :api do
get '/about', to: 'pages#about'
get '/contact', to: 'pages#contact'
end
mount_devise_token_auth_for 'User', at: 'api/auth', controllers: {
sessions: 'devise_overrides/sessions',
}
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
match '*path', to: 'api#api', via: :get
end And changing |
Thanks @TomasAchmedovas adding |
I am using
html5Mode
so my url's are without#
, but then I try to enter confirmation link inside email message I get this:http://127.0.0.1:3000/sign_up#%3Faccount_confirmation_success=true&client_id=D3q1_t6o7ciD0f89F6Yacg&config=default&expiry=&token=CW4xRs3z-4gb__jVo-4eKQ&[email protected]
I tried to change url manually and it redirect seems correct, but I get 500 error in web console:
URL:
http://127.0.0.1:3000/sign_up?account_confirmation_success=true&client_id=D3q1_t6o7ciD0f89F6Yacg&config=default&expiry=&token=CW4xRs3z-4gb__jVo-4eKQ&[email protected]
500 error:
http://127.0.0.1:3000/api/auth/validate_token
NoMethodError in DeviseTokenAuth::TokenValidationsController#validate_token undefined method 'name' for nil:NilClass
Which appears to be this
In rails log i get this error:
NoMethodError (undefined method 'name' for nil:NilClass): app/controllers/application_controller.rb:25:in 'configure_permitted_parameters'
25 line:
Email confirmation is successful, but
auth:email-confirmation-success
isn't called either is auto login(or I need to set it myself?)Link problem root seems to be here
P.S. I use
login
to login with username or email in same field. If you need additional info on this please ask. (actually it's small edit it sessions_controller). Sign in works perfectly fine.The text was updated successfully, but these errors were encountered: