app/controllers/devise_token_auth/omniauth_callbacks_controller.rb
# intermediary route for successful omniauth authentication. omniauth does
# not support multiple models, so we must resort to this terrible hack.
intermediary route for successful omniauth authentication. omniauth does
not support multiple models, so we must resort to this terrible hack.
intermediary route for successful omniauth authentication . omniauth does not support multiple models so we must resort to this terrible hack .
def redirect_callbacks
      devise_mapping = [request.env['omniauth.params']['namespace_name'],
                        request.env['omniauth.params']['resource_class'].underscore.gsub('/', '_')].compact.join('_')
      path = "#{Devise.mappings[devise_mapping.to_sym].fullpath}/#{params[:provider]}/callback"
      klass = request.scheme == 'https' ? URI::HTTPS : URI::HTTP
      redirect_route = klass.build(host: request.host, port: request.port, path: path).to_s
      session['dta.omniauth.auth'] = request.env['omniauth.auth'].except('extra')
      session['dta.omniauth.params'] = request.env['omniauth.params']
      redirect_to redirect_route
    end
def redirect_callbacks devise_mapping = [ request . env [ 'omniauth.params' ] [ 'namespace_name' ] , request . env [ 'omniauth.params' ] [ 'resource_class' ] . underscore . gsub ( '/' , '_' ) ] . compact . join ( '_' ) path = "#{Devise.mappings[devise_mapping.to_sym].fullpath}/#{params[:provider]}/callback" klass = request . scheme == 'https' ? URI :: HTTPS : URI :: HTTP redirect_route = klass . build ( host : request . host , port : request . port , path : path ) . to_s session [ 'dta.omniauth.auth' ] = request . env [ 'omniauth.auth' ] . except ( 'extra' ) session [ 'dta.omniauth.params' ] = request . env [ 'omniauth.params' ] redirect_to redirect_route end
intermediary route for successful omniauth authentication.
intermediary route for successful omniauth authentication .
# derive target redirect route from 'resource_class' param, which was set # before authentication. # preserve omniauth info for success route. ignore 'extra' in twitter # auth response to avoid CookieOverflow.