ruby on rails - devise confirmation_url in HTTPS -


My website is completely SSL, so I would also like to generate the URL generated by devise (3.2.2) for e-mail verification It may be that https: // ....

is currently generated by the URL:

  confirmation_url (@resource,: confirmation_token = & Gt;; @ token)   

which produces good URL:

  http://example.com/users/confirmation?confirmation_token = ZqfHS35ckLQZscSbsgMm   

I should be url

  https://example.com/users/confirmation?confirmation_token=zqfHS35ckLQZscSbsgMm   

this Apart from this, email verification is currently not working, as NGX operates a redirect for every page equivalent https , and for some reasons the things get messed up and https The version is a corrupt URL, such as:

  https://example.com/users/confirmation?confirmation_token=zqfHS35ckLQZscSbsgMm?confirmation_token=zqfHS35ckLQZscSbsgMm   < P> nginx redirects to this corrupted URL for some reasons, so unicorn requests are not rejected can do.  

Any clues?

You can either specify the protocol in the email template, as you did in your reply, or You can specify this as a default in the mailer. The easiest way to do this, if you are happy to use all the email to https link, then add it to your app config. For example, in your production.rb:

  config.action_mailer.default_url_options = {: protocol = & gt; 'Https' ,: host = & gt; 'Example.com'} I know that if you are going straight to https it does not matter, but after nginx your URL will appear on http to https such as Adding this query is a string for the entire URL, so it would be worth it to decide that it also works in all cases, even if you do not need it for email. If you have a  return 301 in nginx config ?? | If you are using the statement, then there may be a trailing  $ query_string  or  $ args  for example, if you type  $ request_uri  If you are using GET parameter already in it.  

In addition, I do not think confirmation_url will be defined directly anywhere. If you try rake routes you might see one of them:

  user_confirmation GET / users / confirmation (.format) {: controller = & gt; ; Commonly available users_configure_url will be automatically in the form of Helper. I think that by planning again you can allow the use of the confirmation because you are using due diligence of your scope (in this case 'user'), although I have to admit that I have to code Have not seen enough, so that it can be seen how it will know how it works.   

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -