mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 12:59:12 -05:00
🐛 Fix issues with gitlab oidc provider
This commit is contained in:
parent
6bd2dcff2a
commit
edf53840de
1 changed files with 16 additions and 13 deletions
|
@ -97,8 +97,8 @@
|
||||||
info)
|
info)
|
||||||
(ex/raise :type :internal
|
(ex/raise :type :internal
|
||||||
:code :unable-to-retrieve-user-info
|
:code :unable-to-retrieve-user-info
|
||||||
::http-status status
|
:http-status status
|
||||||
::http-body body)))))
|
:http-body body)))))
|
||||||
|
|
||||||
(s/def ::backend ::us/not-empty-string)
|
(s/def ::backend ::us/not-empty-string)
|
||||||
(s/def ::email ::us/not-empty-string)
|
(s/def ::email ::us/not-empty-string)
|
||||||
|
@ -224,7 +224,8 @@
|
||||||
(redirect-response uri))))
|
(redirect-response uri))))
|
||||||
|
|
||||||
(defn- auth-handler
|
(defn- auth-handler
|
||||||
[{:keys [tokens] :as cfg} {:keys [params] :as request} respond _]
|
[{:keys [tokens] :as cfg} {:keys [params] :as request} respond raise]
|
||||||
|
(try
|
||||||
(let [props (extract-utm-props params)
|
(let [props (extract-utm-props params)
|
||||||
state (tokens :generate
|
state (tokens :generate
|
||||||
{:iss :oauth
|
{:iss :oauth
|
||||||
|
@ -232,7 +233,9 @@
|
||||||
:props props
|
:props props
|
||||||
:exp (dt/in-future "15m")})
|
:exp (dt/in-future "15m")})
|
||||||
uri (build-auth-uri cfg state)]
|
uri (build-auth-uri cfg state)]
|
||||||
(respond (yrs/response 200 {:redirect-uri uri}))))
|
(respond (yrs/response 200 {:redirect-uri uri})))
|
||||||
|
(catch Throwable cause
|
||||||
|
(raise cause))))
|
||||||
|
|
||||||
(defn- callback-handler
|
(defn- callback-handler
|
||||||
[cfg request respond _]
|
[cfg request respond _]
|
||||||
|
@ -242,7 +245,7 @@
|
||||||
(generate-redirect cfg request info profile)))
|
(generate-redirect cfg request info profile)))
|
||||||
|
|
||||||
(handle-error [cause]
|
(handle-error [cause]
|
||||||
(l/warn :hint "error on oauth process" :cause cause)
|
(l/error :hint "error on oauth process" :cause cause)
|
||||||
(respond (generate-error-redirect cfg cause)))]
|
(respond (generate-error-redirect cfg cause)))]
|
||||||
|
|
||||||
(-> (process-request)
|
(-> (process-request)
|
||||||
|
@ -394,7 +397,7 @@
|
||||||
:scopes #{"openid" "profile" "email"}
|
:scopes #{"openid" "profile" "email"}
|
||||||
:auth-uri (str base "/oauth/authorize")
|
:auth-uri (str base "/oauth/authorize")
|
||||||
:token-uri (str base "/oauth/token")
|
:token-uri (str base "/oauth/token")
|
||||||
:user-uri (str base "/api/v4/user")
|
:user-uri (str base "/oauth/userinfo")
|
||||||
:name "gitlab"}]
|
:name "gitlab"}]
|
||||||
(if (and (string? (:client-id opts))
|
(if (and (string? (:client-id opts))
|
||||||
(string? (:client-secret opts)))
|
(string? (:client-secret opts)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue