diff --git a/backend/src/app/config.clj b/backend/src/app/config.clj index 6cb122621..5e490b676 100644 --- a/backend/src/app/config.clj +++ b/backend/src/app/config.clj @@ -113,8 +113,7 @@ (s/def ::worker-default-parallelism ::us/integer) (s/def ::worker-webhook-parallelism ::us/integer) -(s/def ::authenticated-cookie-domain ::us/string) -(s/def ::authenticated-cookie-name ::us/string) +(s/def ::auth-data-cookie-domain ::us/string) (s/def ::auth-token-cookie-name ::us/string) (s/def ::auth-token-cookie-max-age ::dt/duration) @@ -222,7 +221,6 @@ ::audit-log-http-handler-concurrency ::auth-token-cookie-name ::auth-token-cookie-max-age - ::authenticated-cookie-name ::authenticated-cookie-domain ::database-password ::database-uri diff --git a/backend/src/app/http/session.clj b/backend/src/app/http/session.clj index c4a3f0ba6..bf8fea2dc 100644 --- a/backend/src/app/http/session.clj +++ b/backend/src/app/http/session.clj @@ -10,6 +10,7 @@ [app.common.data :as d] [app.common.logging :as l] [app.common.spec :as us] + [app.common.uri :as u] [app.config :as cf] [app.db :as db] [app.db.sql :as sql] @@ -33,7 +34,7 @@ ;; A cookie that we can use to check from other sites of the same ;; domain if a user is authenticated. -(def default-authenticated-cookie-name "authenticated") +(def default-auth-data-cookie-name "auth-data") ;; Default value for cookie max-age (def default-cookie-max-age (dt/duration {:days 7})) @@ -133,9 +134,9 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (declare ^:private assign-auth-token-cookie) -(declare ^:private assign-authenticated-cookie) +(declare ^:private assign-auth-data-cookie) (declare ^:private clear-auth-token-cookie) -(declare ^:private clear-authenticated-cookie) +(declare ^:private clear-auth-data-cookie) (declare ^:private gen-token) (defn create-fn @@ -153,7 +154,7 @@ (l/trace :hint "create" :profile-id (str profile-id)) (-> response (assign-auth-token-cookie session) - (assign-authenticated-cookie session))))) + (assign-auth-data-cookie session))))) (defn delete-fn [{:keys [::manager]}] @@ -167,7 +168,7 @@ (assoc :status 204) (assoc :body nil) (clear-auth-token-cookie) - (clear-authenticated-cookie))))) + (clear-auth-data-cookie))))) (defn- gen-token [props {:keys [profile-id created-at]}] @@ -229,7 +230,7 @@ (let [session (update! manager session)] (-> response (assign-auth-token-cookie session) - (assign-authenticated-cookie session))) + (assign-auth-data-cookie session))) response)))) (def soft-auth @@ -262,11 +263,11 @@ :secure secure?}] (update response :cookies assoc name cookie))) -(defn- assign-authenticated-cookie - [response {updated-at :updated-at}] +(defn- assign-auth-data-cookie + [response {profile-id :profile-id updated-at :updated-at}] (let [max-age (cf/get :auth-token-cookie-max-age default-cookie-max-age) - domain (cf/get :authenticated-cookie-domain) - cname (cf/get :authenticated-cookie-name "authenticated") + domain (cf/get :auth-data-cookie-domain) + cname default-auth-data-cookie-name created-at (or updated-at (dt/now)) renewal (dt/plus created-at default-renewal-max-age) @@ -274,14 +275,17 @@ comment (str "Renewal at: " (dt/format-instant renewal :rfc1123)) secure? (contains? cf/flags :secure-session-cookies) + strict? (contains? cf/flags :strict-session-cookies) + cors? (contains? cf/flags :cors) cookie {:domain domain :expires expires :path "/" :comment comment - :value true - :same-site :strict + :value (u/map->query-string {:profile-id profile-id}) + :same-site (if cors? :none (if strict? :strict :lax)) :secure secure?}] + (cond-> response (string? domain) (update :cookies assoc cname cookie)))) @@ -291,10 +295,10 @@ (let [cname (cf/get :auth-token-cookie-name default-auth-token-cookie-name)] (update response :cookies assoc cname {:path "/" :value "" :max-age 0}))) -(defn- clear-authenticated-cookie +(defn- clear-auth-data-cookie [response] - (let [cname (cf/get :authenticated-cookie-name default-authenticated-cookie-name) - domain (cf/get :authenticated-cookie-domain)] + (let [cname default-auth-data-cookie-name + domain (cf/get :auth-data-cookie-domain)] (cond-> response (string? domain) (update :cookies assoc cname {:domain domain :path "/" :value "" :max-age 0})))) diff --git a/frontend/translations/af.po b/frontend/translations/af.po index 55c10b660..8710de46c 100644 --- a/frontend/translations/af.po +++ b/frontend/translations/af.po @@ -392,7 +392,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Lêers wat by biblioteke gevoeg is, sal hier verskyn. Probeer om jou lêers " "te deel of voeg by vanaf ons [Biblioteke en " -"sjablone](https://penpot.app/libraries-templates.html)." +"sjablone](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Laai %s Penpot lêers (.penpot) af" diff --git a/frontend/translations/ar.po b/frontend/translations/ar.po index 2ec16828b..b6990306f 100644 --- a/frontend/translations/ar.po +++ b/frontend/translations/ar.po @@ -301,7 +301,7 @@ msgstr "تكرير %s الملفات" msgid "dashboard.empty-placeholder-drafts" msgstr "" "أوه لا! ليس لديك ملفات بعد! إذا كنت تريد تجربة بعض القوالب ، فانتقل إلى " -"[المكتبات والقوالب] (https://penpot.app/libraries-templates.html)" +"[المكتبات والقوالب] (https://penpot.app/libraries-templates)" msgid "dashboard.export-binary-multi" msgstr "تنزيل ملفات ٪s Penpot (.penpot)" diff --git a/frontend/translations/ca.po b/frontend/translations/ca.po index ffa795e91..a8b6c72e4 100644 --- a/frontend/translations/ca.po +++ b/frontend/translations/ca.po @@ -307,7 +307,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Encara no hi ha fitxers. Si voleu provar algunes plantilles, podeu anar a " "la secció [Biblioteques i " -"plantilles](https://penpot.app/libraries-templates.html)" +"plantilles](https://penpot.app/libraries-templates)" msgid "dashboard.export-binary-multi" msgstr "Baixa %s fitxers Penpot (.penpot)" diff --git a/frontend/translations/cs.po b/frontend/translations/cs.po index 8d7f51983..e14077e64 100644 --- a/frontend/translations/cs.po +++ b/frontend/translations/cs.po @@ -406,7 +406,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Zde se zobrazí soubory přidané do knihoven. Zkuste své soubory sdílet nebo " "je přidat z našich [Libraries & " -"templates](https://penpot.app/libraries-templates.html)." +"templates](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Stáhnout soubory %s Penpot (.penpot)" diff --git a/frontend/translations/en.po b/frontend/translations/en.po index f83ab5880..58ea94696 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -408,7 +408,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Files added to Libraries will appear here. Try sharing your files or add " "from our [Libraries & " -"templates](https://penpot.app/libraries-templates.html)." +"templates](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Download %s Penpot files (.penpot)" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index d0ad70298..5fc709ae2 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -416,7 +416,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Los archivos agregados a las bibliotecas aparecerán aquí. Si quieres probar " "con alguna plantilla ve a [Bibliotecas y " -"plantillas](https://penpot.app/libraries-templates.html)." +"plantillas](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Descargar %s archivos Penpot (.penpot)" diff --git a/frontend/translations/es_419.po b/frontend/translations/es_419.po index dd1380c28..19d4ba022 100644 --- a/frontend/translations/es_419.po +++ b/frontend/translations/es_419.po @@ -404,7 +404,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Los archivos agregados a las Bibliotecas aparecerán aquí. Intente compartir " "sus archivos o agréguelos desde nuestras [Libraries & " -"templates](https://penpot.app/libraries-templates.html)." +"templates](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Descargar %s archivos Penpot (.penpot)" diff --git a/frontend/translations/eu.po b/frontend/translations/eu.po index 4db439f6e..c65fa34b1 100644 --- a/frontend/translations/eu.po +++ b/frontend/translations/eu.po @@ -305,7 +305,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Oh ez! Oraindik ez duzu fitxategirik! Txantiloi batekin proba egin nahi " "baduzu joan [Liburutegi eta " -"txantiloiak](https://penpot.app/libraries-templates.html) atalera." +"txantiloiak](https://penpot.app/libraries-templates) atalera." msgid "dashboard.export-binary-multi" msgstr "Deskargatu %s Penpot fitxategi (.penpot)" diff --git a/frontend/translations/fa.po b/frontend/translations/fa.po index abbbc8c5b..94bd12a19 100644 --- a/frontend/translations/fa.po +++ b/frontend/translations/fa.po @@ -304,7 +304,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "وای نه! شما هنوز هیچ فایلی ندارید! اگر می‌خواهید چند الگو را امتحان کنید، " "به [کتابخانه‌ها و الگوها] بروید " -"(https://penpot.app/libraries-templates.html)" +"(https://penpot.app/libraries-templates)" #, fuzzy msgid "dashboard.export-binary-multi" diff --git a/frontend/translations/fo.po b/frontend/translations/fo.po index b4065190c..91f47b88d 100644 --- a/frontend/translations/fo.po +++ b/frontend/translations/fo.po @@ -294,7 +294,7 @@ msgstr "Tvítak %s fílur" msgid "dashboard.empty-placeholder-drafts" msgstr "" "Áh nei! Tú hevur ongar fílur enn! Um tú vilt royna við nøkrum skapilónum, " -"vitja [Libraries & templates](https://penpot.app/libraries-templates.html)" +"vitja [Libraries & templates](https://penpot.app/libraries-templates)" msgid "dashboard.export-binary-multi" msgstr "Heinta %s Penpot fílur (.penpot)" diff --git a/frontend/translations/fr.po b/frontend/translations/fr.po index 91571b084..f8aa6622a 100644 --- a/frontend/translations/fr.po +++ b/frontend/translations/fr.po @@ -397,7 +397,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Oh non ! Vous n'avez pas encore de fichiers ! Si vous voulez essayer avec " "des modèles, allez sur [Bibliothèques et modèles] " -"(https://penpot.app/libraries-templates.html)." +"(https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Télécharger %s fichiers Penpot (.penpot)" diff --git a/frontend/translations/gl.po b/frontend/translations/gl.po index e1b8b4d81..07371e67d 100644 --- a/frontend/translations/gl.po +++ b/frontend/translations/gl.po @@ -302,7 +302,7 @@ msgstr "Duplicar % ficheiros" msgid "dashboard.empty-placeholder-drafts" msgstr "" "Ai non! Ainda non tes ficheiros! Se queres facer a proba con algún modelo " -"vai a [Bibliotecas e modelos] (https://penpot.app/libraries-templates.html)" +"vai a [Bibliotecas e modelos] (https://penpot.app/libraries-templates)" msgid "dashboard.export-binary-multi" msgstr "Descargar %s ficheiros Penpot (.penpot)" diff --git a/frontend/translations/he.po b/frontend/translations/he.po index ba1ffe02e..767159262 100644 --- a/frontend/translations/he.po +++ b/frontend/translations/he.po @@ -402,7 +402,7 @@ msgstr "שכפול %s קבצים" msgid "dashboard.empty-placeholder-drafts" msgstr "" "קבצים שנוספו לספריות יתווספו לכאן. כדאי לנסות לשתף את הקבצים שלך או להוסיף " -"אותם מ[הספריות והתבניות](https://penpot.app/libraries-templates.html)." +"אותם מ[הספריות והתבניות](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "הורדת %s קובצי Penpot‏ (‎.penpot)" diff --git a/frontend/translations/hr.po b/frontend/translations/hr.po index c51d077c9..62833e1c0 100644 --- a/frontend/translations/hr.po +++ b/frontend/translations/hr.po @@ -304,7 +304,7 @@ msgstr "Kopiraj %s datoteka" msgid "dashboard.empty-placeholder-drafts" msgstr "" "O ne! Još nemaš datoteka! Ako želiš isprobati neke predloške, idi na " -"[Biblioteke i predlošci](https://penpot.app/libraries-templates.html)" +"[Biblioteke i predlošci](https://penpot.app/libraries-templates)" msgid "dashboard.export-binary-multi" msgstr "Preuzmi %s Penpot datoteke (.penpot)" diff --git a/frontend/translations/id.po b/frontend/translations/id.po index 276c9c831..20eaae391 100644 --- a/frontend/translations/id.po +++ b/frontend/translations/id.po @@ -404,7 +404,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Berkas yang ditambahkan ke Pustaka akan muncul di sini. Coba membagikan " "berkas Anda atau menambahkan dari [Pustaka & " -"templat](https://penpot.app/libraries-templates.html) kami." +"templat](https://penpot.app/libraries-templates) kami." msgid "dashboard.export-binary-multi" msgstr "Unduh %s berkas Penpot (.penpot)" diff --git a/frontend/translations/it.po b/frontend/translations/it.po index 538d09b8a..5982defb5 100644 --- a/frontend/translations/it.po +++ b/frontend/translations/it.po @@ -300,7 +300,7 @@ msgstr "Duplicare %s file" msgid "dashboard.empty-placeholder-drafts" msgstr "" "Oh no! Non hai ancora nessun file! Se desideri provare alcuni template vai " -"su [Librerie e template](https://penpot.app/libraries-templates.html)" +"su [Librerie e template](https://penpot.app/libraries-templates)" msgid "dashboard.export-binary-multi" msgstr "Scarica %s file Penpot (.penpot)" diff --git a/frontend/translations/jpn_JP.po b/frontend/translations/jpn_JP.po index e2de68012..f4cc12087 100644 --- a/frontend/translations/jpn_JP.po +++ b/frontend/translations/jpn_JP.po @@ -263,7 +263,7 @@ msgstr "%s ファイルを複製" msgid "dashboard.empty-placeholder-drafts" msgstr "" "まだファイルがありません。もしいくつかのテンプレートを試してみたいなら、[Libraries & " -"templates](https://penpot.app/libraries-templates.html) をチェックしてみてください。" +"templates](https://penpot.app/libraries-templates) をチェックしてみてください。" msgid "dashboard.export-frames" msgstr "PDFでエクスポート" diff --git a/frontend/translations/lt.po b/frontend/translations/lt.po index a59ca0220..8ff0a9c75 100644 --- a/frontend/translations/lt.po +++ b/frontend/translations/lt.po @@ -293,7 +293,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Čia bus rodomi prie bibliotekų pridėti failai. Pabandykite bendrinti failus " "arba pridėti iš mūsų [Bibliotekos ir šablonai] " -"(https://penpot.app/libraries-templates.html)" +"(https://penpot.app/libraries-templates)" msgid "dashboard.export-frames" msgstr "Eksportuokite darbalaukius į PDF" diff --git a/frontend/translations/lv.po b/frontend/translations/lv.po index cb09b0747..d7e53bfd6 100644 --- a/frontend/translations/lv.po +++ b/frontend/translations/lv.po @@ -413,7 +413,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Šeit tiks parādītas bibliotēkām pievienotās datnes. Mēģini koplietot datnes " "vai pievienot tās no mūsu [bibliotēkām un " -"veidnēm](https://penpot.app/libraries-templates.html)." +"veidnēm](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Lejupielādēt %s Penpot datnes (.penpot)" diff --git a/frontend/translations/ml.po b/frontend/translations/ml.po index b14a96f5c..ed5ca4689 100644 --- a/frontend/translations/ml.po +++ b/frontend/translations/ml.po @@ -221,7 +221,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "ഇതുവരെയും ഇവിടെ ഫയലുകളില്ല. നിങ്ങൾക്ക് ചില ടെമ്പ്ലേറ്റുകൾ " "പരീക്ഷിക്കണമെന്നുണ്ടെങ്കിൽ [ലൈബ്രറികളുടെയും ടെമ്പ്ലേറ്റുകളുടെയും " -"വിഭാഗത്തിലേക്ക്] (https://penpot.app/libraries-templates.html) പോകാവുന്നതാണ്" +"വിഭാഗത്തിലേക്ക്] (https://penpot.app/libraries-templates) പോകാവുന്നതാണ്" msgid "dashboard.export-frames" msgstr "ആർട്ട്ബോർഡുകൾ പിഡിഎഫായി എക്സ്പോർട്ട് ചെയ്യുക" diff --git a/frontend/translations/ms.po b/frontend/translations/ms.po index 060bdec12..959ae1bfb 100644 --- a/frontend/translations/ms.po +++ b/frontend/translations/ms.po @@ -387,7 +387,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Fail yang ditambahkan pada Perpustakaan akan dipaparkan di sini. Cuba " "kongsi fail anda atau tambahkan daripada [Perpustakaan & " -"templat](https://penpot.app/libraries-templates.html) kami." +"templat](https://penpot.app/libraries-templates) kami." msgid "dashboard.export-binary-multi" msgstr "Muat turun %s fail Penpot (.penpot)" diff --git a/frontend/translations/nl.po b/frontend/translations/nl.po index 1e8762061..d117b484e 100644 --- a/frontend/translations/nl.po +++ b/frontend/translations/nl.po @@ -427,7 +427,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Bestanden die aan bibliotheken zijn toegevoegd, worden hier weergegeven. " "Probeer je bestanden te delen of toe te voegen vanuit onze [Bibliotheken & " -"sjablonen] (https://penpot.app/libraries-templates.html)." +"sjablonen] (https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "%s Penpot-bestanden downloaden (.penpot)" diff --git a/frontend/translations/pl.po b/frontend/translations/pl.po index 951ad648d..e7f53b5b6 100644 --- a/frontend/translations/pl.po +++ b/frontend/translations/pl.po @@ -305,7 +305,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Tutaj pojawią się pliki dodane do Bibliotek. Spróbuj udostępnić swoje pliki " "lub dodać z naszych [Bibliotek i " -"szablonów](https://penpot.app/libraries-templates.html)." +"szablonów](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Pobierz %s plików Penpot (.penpot)" diff --git a/frontend/translations/pt_BR.po b/frontend/translations/pt_BR.po index b2eee4944..6543c151b 100644 --- a/frontend/translations/pt_BR.po +++ b/frontend/translations/pt_BR.po @@ -303,7 +303,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Arquivos adicionados na biblioteca de ativos vão aparecer aqui. Tente " "compartilhar seus arquivos ou adicione das nossas [Bibliotecas & " -"modelos](https://penpot.app/libraries-templates.html)." +"modelos](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Baixar %s arquivos Penpot (.penpot)" diff --git a/frontend/translations/pt_PT.po b/frontend/translations/pt_PT.po index b7c914757..6b0f9c6e2 100644 --- a/frontend/translations/pt_PT.po +++ b/frontend/translations/pt_PT.po @@ -403,7 +403,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Os ficheiros adicionados às Bibliotecas irão aparecer aqui. Experimenta " "adicionar os teus ficheiros ou experimenta algumas das nossas [Bibliotecas " -"e templates](https://penpot.app/libraries-templates.html)." +"e templates](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Descarrega %s ficheiros Penpot (.penpot)" diff --git a/frontend/translations/ro.po b/frontend/translations/ro.po index bd69468e9..15b62c4cc 100644 --- a/frontend/translations/ro.po +++ b/frontend/translations/ro.po @@ -402,7 +402,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Fișierele adăugate la Biblioteci vor apărea aici. Încercați să partajați " "fișierele dvs. sau adăugați-le din [Biblioteci și " -"șabloane](https://penpot.app/libraries-templates.html)." +"șabloane](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Descărcați %s fișiere Penpot (.penpot)" diff --git a/frontend/translations/ru.po b/frontend/translations/ru.po index 8ec32ba61..0dd945727 100644 --- a/frontend/translations/ru.po +++ b/frontend/translations/ru.po @@ -323,7 +323,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Файлы, добавленные в Библиотеки, появятся здесь. Попробуйте поделиться " "своими файлами или добавить их из наших [Библиотек и " -"шаблонов](https://penpot.app/libraries-templates.html)." +"шаблонов](https://penpot.app/libraries-templates)." msgid "dashboard.export-binary-multi" msgstr "Скачать файлы Penpot (.penpot) (%s)" diff --git a/frontend/translations/tr.po b/frontend/translations/tr.po index 4c189ef09..1e22290d9 100644 --- a/frontend/translations/tr.po +++ b/frontend/translations/tr.po @@ -415,7 +415,7 @@ msgid "dashboard.empty-placeholder-drafts" msgstr "" "Kütüphanelere eklenen dosyalar burada görünecektir. Dosyalarınızı " "paylaşmayı deneyin veya [Kütüphaneler ve " -"şablonlarımızdan](https://penpot.app/libraries-templates.html) ekleyin." +"şablonlarımızdan](https://penpot.app/libraries-templates) ekleyin." msgid "dashboard.export-binary-multi" msgstr "%s Penpot dosyasını indir (.penpot)" diff --git a/frontend/translations/zh_Hant.po b/frontend/translations/zh_Hant.po index 5f14d51cb..099c82167 100644 --- a/frontend/translations/zh_Hant.po +++ b/frontend/translations/zh_Hant.po @@ -291,7 +291,7 @@ msgstr "複製 %s 個檔案" msgid "dashboard.empty-placeholder-drafts" msgstr "" "添加在資料庫的檔案會在此處列出。請分享你的檔案或由我們的 [資料庫 & " -"模板區段](https://penpot.app/libraries-templates.html) 添加。" +"模板區段](https://penpot.app/libraries-templates) 添加。" msgid "dashboard.export-binary-multi" msgstr "下載 %s 個Penpot 檔案 (.penpot)"