Ruby on Rails
Wednesday, November 25, 2015
On Wednesday, November 25, 2015 at 12:36:46 PM UTC, Ruby-Forum.com User wrote:
Hi All,
I am generate base64 link with some params, that link send to user
email, it's worked fine.
Not sure what your question is, but the stack trace in your attachment refer to code other than what you have posted.
Fred
When I need to verify user email, user must and should click on email
from that link I have take token which is generated by me.
in mailer:
----------
% @link = url_for controller: 'api/v1/hum_os',
action: 'validate_verification_link',
protocol: 'https',
host: 'sikkacfprovider.mybluemix.net',
query: @query %>
in controller:
------------
def create_link
unique_token = generate_token
session[:token] = unique_token
end
def verify_link
query_data = decode_base64_string(query)
@parsed_query_data = JSON.parse(query_data)
if @parsed_query_data["token"] == session[:token]
true
else
false
end
# here session[:token] nil for other browsers and other systems except
my system
end
if link open in other system or other browser:
---------------------------------------------
image: Screen_Shot_2015-11-25_at_5.08.15_PM.png
if link open in my chrome browser:
----------------------------------
image: Screen_Shot_2015-11-25_at_5.08.33_PM.png
Attachments:
http://www.ruby-forum.com/attachment/11160/Screen_Shot_ 2015-11-25_at_5.08.15_PM.png
http://www.ruby-forum.com/attachment/11161/Screen_Shot_ 2015-11-25_at_5.08.33_PM.png
--
Posted via http://www.ruby-forum.com/.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/646d2f89-ccfe-42ce-b462-aea4a852e5e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment