Skip to content

Instantly share code, notes, and snippets.

@AdamSaleh
Created February 26, 2013 20:44
Show Gist options
  • Save AdamSaleh/5041999 to your computer and use it in GitHub Desktop.
Save AdamSaleh/5041999 to your computer and use it in GitHub Desktop.
([] (login *session-user* *session-password* {:org *session-org*}))
([username password & [{:keys [org default-org]}]]
(when (logged-in?) (logout))
(sel/fill-ajax-form {::username-text username
::password-text password}
::log-in)
(let [retval (notification/check-for-success {:timeout-ms 20000})
direct-login? (some (fn [n] (or (= "Login Successful" n)
(re-find #"please contact administrator" n)
(re-find #"logging into" n)))
(mapcat :notices retval))]
;; if user only has access to one org, he will bypass org select
(if direct-login?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment