I need to open access to a no username and password to my application.
What i did was i added a *userkey* field on my users model that can be past
via a get or post method from another site.
that will then find the correct user and log them in as if they had put in
there user name and password.
Now i am using device to log in my users. but i am not sure where to append
the second login method.
in my user controller i have
*def login_bypass
id = params[:id]
@u = User.find_by_**userkey(id)
if @u == nil
flash[:error] = t(:please_contact_support)
redirect_to login_path
else
// device log in with @u info
flash[:success] = t(:welcome_to_the_site)
redirect_to users_path
end
end *
any one know how should i go on?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/wm5xlloH5IIJ.
For more options, visit https://groups.google.com/groups/opt_out.
The 21/11/12, Moises Zaragoza wrote:> I need to open access to a no username and password to my application. > > What i did was i added a userkey field on my users model that can be past > via a get or post method from another site. > that will then find the correct user and log them in as if they had put in > there user name and password.I don''t know for your specific question but you really should look for information about how to let other open authenticated sessions. You might find stuff and take inspiration from Facebook, Tweeter, GitHub or whatever website offering public API. -- Nicolas Sebrecht -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.