       google: ->
 
         { client_id } = KONFIG.google
+        JSession = require './session'
         JSession.one { clientId: client.sessionToken }, (err, session) ->
           return callback err  if err
           state = session._id



  @saveTokens = (client, provider, credentials, callback) ->
    JSession.one { clientId: client.sessionToken }, (err, session) ->
      return callback err  if err
      return callback new KodingError 'Session not found'  unless session


        callback null, url

    }[provider] ? -> callback new KodingError 'No such provider')()


  @getUrl = secure (client, urlOptions, callback) ->

    { provider } = urlOptions

    if redirectUri = KONFIG[provider].redirectUri or KONFIG[provider].redirect_uri
      redirectUri  = @prependGroupName redirectUri, client.context.group
