    (fn [{:keys [request response] :as context}]
      (let [access-token (get-in request [:headers "authorization"])
            remove-access-token (dao/get-fn :remove-access-token context)
-           web-client-redirect (remove-slash (get-in request [:headers "referer"]))]
+           web-client-redirect (get-formatted-referer request)]
 
        (when access-token
          @(remove-access-token access-token))

                   client-secret
                   signing-secret]} (get-github-settings context)
           {:keys [code state]} (:query-params request)
           web-client-redirect (remove-slash (get-in request [:headers "referer"]))
           failed-callback (redirect-home context web-client-redirect)]

       (if (= state signing-secret)

(ns wombats.handlers.auth
  (:require [clojure.string :refer [ends-with? join split]]
            [io.pedestal.interceptor.helpers :as interceptor]
            [org.httpkit.client :as http]
            [cheshire.core :refer [parse-string]]
            [wombats.interceptors.github :refer [get-github-settings]]
