On Fri, Feb 14, 2014 at 4:33 AM, Ganesh Ranganathan <ganesh.ranganathan...@gmail.com> wrote: > > I am using omniauth-oauth2 in rails to authenticate to a site which supports > oauth2. The site gives me after doing the oauth dance, which I then persist > into the database > > Access Token > Expires_AT (ticks) > Refresh token > > Is there an omniauth method to refresh the token automatically after it > expires or should I write custom code which to do the same. > > If custom code is to be written, is a helper the right place to write the > logic?
Last I remember omniauth does not support this at all. No, a helper is not the best place to do it, you should probably either background check the token and refresh it there or add it as a method to the user model since it's related to the user and it's behavior. -- 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+unsubscr...@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/CAM5XQnxwPFE%3DAYBbK%3DtNwR4ObNWU03gMJpmgF8KkgRYANi1C7g%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.