Should fix most of the authentication issues

This commit is contained in:
2023-09-05 23:08:22 -07:00
parent a6e4080746
commit a56d3b0b84
22 changed files with 506 additions and 179 deletions

View File

@@ -39,6 +39,7 @@
[:name
:profile_image_url
:email
:impersonate_jwt
:id
:role
[:clients [:id :name]]]]]}

View File

@@ -32,7 +32,7 @@
[grid/header-cell {} "Email"]
[grid/header-cell {} "Role"]
[grid/header-cell {} "Clients"]
[grid/header-cell {:style {:width (action-cell-width 1)}}]]]
[grid/header-cell {:style {:width (action-cell-width 5)}}]]]
[grid/body
(for [{:keys [id name role clients] :as c} (:data page)]
^{:key (str name "-" id)}
@@ -50,6 +50,14 @@
[grid/cell {} role]
[grid/cell {} (str/join ", " (map :name clients))]
[grid/cell {}
[:a.button {:on-click (fn []
(.setItem js/localStorage "jwt" (:impersonate-jwt c))
(.removeItem js/localStorage "last-client-id" nil)
(.removeItem js/localStorage "last-selected-clients" nil)
(.reload (.-location js/document ) true))}
"Impersonate"]
[buttons/fa-icon {:event [::form/editing c]
:icon "fa-pencil"}]]])]]
]))

View File

@@ -8,10 +8,14 @@
[:div.column.is-8.is-offset-2.has-text-centered
[:div.box.slideInFromBelow
[:img {:src "http://www.integreatconsult.com/wp-content/uploads/2016/11/logo.png"}]
[:img {:src "/img/logo.png"}]
[:div.notification.is-danger.is-light "An unexpected error has occured. "
[:a {:on-click #(.reload (.-location js/document )) } "Click here"]
" to try again."]]
[:div [:a {:on-click (fn []
(.removeItem js/localStorage "last-client-id" nil)
(.removeItem js/localStorage "last-selected-clients" nil)
(.reload (.-location js/document ) true)) } "Click here"]
" to try again."]
[:div "If the error continues, please try " [:a {:href "/login"} "logging in"] " again."]]]
[:p.has-text-gray
"Copyright Integreat 2020"]]]]]]
)