       (= (:uri request) (get-in client-config [:callback :path]))
       (calledback request)
 
-      (= (:uri request) "/users/new/done")
-      (let [user (get-in request [:flash :user])]
-        (make-auth {:identity (:id user) :user user :roles #{::role/user}})))))
+      (= (:uri request) "/auth/facebook/app")
+      (login-for-mobile-app request))))

                              "<br/>Description : " error-description
                              "<br/>Request : " request))))

(defn workflow []
  (fn [request]
    (cond

(ns sound-effector.controllers.auth.facebook-with-friend
  (:require
    [clojure.data.json :as json]
    [clojure.string :as string]
    [crypto.random :as random]
    [clj-http.client :as http]
    [ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
    [ring.util.codec :refer [url-encode]]
    [ring.util.response :refer [redirect response status content-type header]]
    [compojure.core :refer [defroutes context GET]]
    [cemerick.friend :as friend]
    [cemerick.friend.workflows :refer [make-auth]]
    [liberator.core :refer [resource]]
    [sound-effector.models.user :as user]
    [sound-effector.models.role :as role]))

