Browse Source

enhance(sync): move login-url to config.cljs and

rcmerci 3 years ago
parent
commit
33336bb1f4
2 changed files with 5 additions and 2 deletions
  1. 1 2
      src/main/frontend/components/header.cljs
  2. 4 0
      src/main/frontend/config.cljs

+ 1 - 2
src/main/frontend/components/header.cljs

@@ -44,8 +44,7 @@
       (if (user-handler/logged-in?)
         [:span.text-sm.font-medium (user-handler/email)]
 
-        [:a.button.text-sm.font-medium.block {:on-click (fn []
-                                                          (js/window.open "https://logseq-test.auth.us-east-2.amazoncognito.com/oauth2/authorize?client_id=4fi79en9aurclkb92e25hmu9ts&response_type=code&scope=email+openid+phone&redirect_uri=logseq%3A%2F%2Fauth-callback"))}
+        [:a.button.text-sm.font-medium.block {:on-click #(js/window.open config/LOGIN-URL)}
          [:span (t :login)]]))))
 
 (rum/defcs file-sync-remote-graphs <

+ 4 - 0
src/main/frontend/config.cljs

@@ -17,6 +17,10 @@
 
 (def test? false)
 
+;; TODO: add :closure-defines in shadow-cljs.edn when prod env is ready
+(goog-define LOGIN-URL
+             "https://logseq-test.auth.us-east-2.amazoncognito.com/oauth2/authorize?client_id=4fi79en9aurclkb92e25hmu9ts&response_type=code&scope=email+openid+phone&redirect_uri=logseq%3A%2F%2Fauth-callback")
+
 ;; :TODO: How to do this?
 ;; (defonce desktop? ^boolean goog.DESKTOP)