From 7c9bb1e830fac0edb9c6fbe6ab0056771a8ed40b Mon Sep 17 00:00:00 2001 From: a-ill Date: Sun, 30 Jul 2023 13:04:15 +0300 Subject: [PATCH] Interim update --- Server/Manifest.toml | 97 +- Server/Project.toml | 2 + Server/app/layouts/main.jl.html | 6 +- .../AuthenticationController.jl | 193 +++ .../authentication/views/auth.jl.html | 2 + .../views/email_confirmation.jl.html | 1 + .../authentication/views/profile.jl.html | 2 + Server/app/resources/basic/BasicController.jl | 2 +- .../resources/communes/CommunesController.jl | 2 +- .../cooperatives/CooperativesController.jl | 2 +- .../app/resources/groups/GroupsController.jl | 12 +- .../resources/parties/PartiesController.jl | 2 +- .../resources/partners/PartnersController.jl | 2 +- Server/app/resources/users/Users.jl | 29 + Server/app/resources/users/UsersValidator.jl | 21 + Server/app/svelte/public/css/auth.css | 171 ++ Server/app/svelte/public/css/common.css | 27 +- Server/app/svelte/public/css/profile.css | 55 + .../svelte/public/js/libraries/authTools.js | 160 ++ .../public/locales/en/navbar-component.json | 4 +- Server/app/svelte/rollup.config.js | 1 + .../app/svelte/src/auth/auth-component.svelte | 128 ++ .../src/auth/confirmation-component.svelte | 131 ++ .../svelte/src/auth/login-component.svelte | 108 ++ .../svelte/src/auth/signup-component.svelte | 241 +++ .../svelte/src/components/pane-aligner.svelte | 28 +- .../svelte/src/footer/footer-component.svelte | 8 +- .../svelte/src/groups-add-component.svelte | 2 +- .../app/svelte/src/landing-component.svelte | 2 +- .../svelte/src/navbar/navbar-logged.svelte | 419 +++++ ...ponent.svelte => navbar-not-logged.svelte} | 5 +- .../src/profile/profile-communes.svelte | 20 + .../src/profile/profile-component.svelte | 265 +++ .../svelte/src/profile/profile-coops.svelte | 20 + .../svelte/src/profile/profile-general.svelte | 415 +++++ .../svelte/src/profile/profile-groups.svelte | 300 ++++ .../svelte/src/profile/profile-parties.svelte | 20 + Server/config/libsoc.org.conf | 44 +- .../2019052410085235_create_table_users.jl | 7 +- .../2022026611846565_create_table_groups.jl | 4 + ...2022026611846566_create_table_communes.jl} | 0 ...026611846567_create_table_cooperatives.jl} | 1 - ...2022026611846568_create_table_partners.jl} | 0 ...6611846569_create_table_groups_requests.jl | 39 + ...1846570_create_table_communes_requests.jl} | 0 ...6611846571_create_table_coops_requests.jl} | 0 ...11846572_create_table_parties_requests.jl} | 0 ...2026611846573_create_table_groups_users.jl | 24 + ...26611846574_create_table_communes_users.jl | 24 + ...1846575_create_table_cooperatives_users.jl | 24 + ...026611846576_create_table_parties_users.jl | 24 + Server/lib/Cookies.jl | 27 + Server/lib/EmailSupport/EmailSupport.jl | 53 + Server/lib/EmailSupport/credentials.json | 4 + Server/plugins/genie_authentication.jl | 8 + Server/public/css/auth.css | 171 ++ Server/public/css/common.css | 27 +- Server/public/css/profile.css | 55 + Server/public/img/auth/eye_icon.svg | 1 + Server/public/img/auth/facebook_icon.svg | 1 + Server/public/img/auth/google_icon.svg | 1 + Server/public/img/auth/linkedin_icon.svg | 1 + Server/public/img/common/communes.svg | 2 +- Server/public/img/profile/icons/general.svg | 1 + Server/public/img/profile/icons/logout.svg | 3 + Server/public/img/profile/icons/pencil.svg | 3 + .../profile/profile_pictures/fierce_bunny.svg | 686 ++++++++ .../profile_pictures/majestic_tiger.svg | 1246 ++++++++++++++ Server/public/js/components/auth-component.js | 229 +++ .../js/components/communes-add-component.js | 736 +++++++- .../js/components/communes-component.js | 647 ++++++- .../public/js/components/compass-component.js | 715 +++++++- .../js/components/confirmation-component.js | 361 ++++ Server/public/js/components/cookies-dialog.js | 100 +- .../components/cooperatives-add-component.js | 684 +++++++- .../js/components/cooperatives-component.js | 815 ++++++++- .../public/js/components/footer-component.js | 348 +++- .../js/components/groups-add-component.js | 684 +++++++- .../public/js/components/groups-component.js | 623 ++++++- Server/public/js/components/index-122ecbb4.js | 513 ++++++ Server/public/js/components/index-6b4fe380.js | 521 ++++++ Server/public/js/components/index-998178c7.js | 524 ++++++ Server/public/js/components/index-ee911aff.js | 53 + Server/public/js/components/index-f9998ce7.js | 53 + Server/public/js/components/index-fb9750f3.js | 53 + .../public/js/components/join-us-component.js | 628 ++++++- .../public/js/components/landing-component.js | 621 ++++++- .../public/js/components/legend-component.js | 363 +++- .../js/components/loadscreen-component.js | 116 +- .../public/js/components/login-component.js | 448 +++++ .../js/components/manifesto-component.js | 1491 ++++++++++++++++- Server/public/js/components/map-component.js | 176 +- .../public/js/components/navbar-component.js | 671 +++++++- Server/public/js/components/navbar-logged.js | 687 ++++++++ .../public/js/components/navbar-not-logged.js | 687 ++++++++ Server/public/js/components/pane-aligner.js | 302 +++- .../js/components/parties-add-component.js | 684 +++++++- .../public/js/components/parties-component.js | 733 +++++++- .../js/components/partners-add-component.js | 651 ++++++- .../js/components/partners-component.js | 732 +++++++- .../public/js/components/profile-component.js | 598 +++++++ .../public/js/components/profile-general.js | 661 ++++++++ Server/public/js/components/profile-group.js | 80 + Server/public/js/components/profile-groups.js | 704 ++++++++ .../js/components/profile-my-details.js | 80 + .../public/js/components/select-component.js | 594 ++++++- .../public/js/components/signup-component.js | 603 +++++++ .../public/js/components/switch-component.js | 210 ++- Server/public/js/libraries/authTools.js | 160 ++ .../public/locales/en/navbar-component.json | 4 +- Server/routes.jl | 30 +- 111 files changed, 25589 insertions(+), 170 deletions(-) create mode 100644 Server/app/resources/authentication/AuthenticationController.jl create mode 100644 Server/app/resources/authentication/views/auth.jl.html create mode 100644 Server/app/resources/authentication/views/email_confirmation.jl.html create mode 100644 Server/app/resources/authentication/views/profile.jl.html create mode 100644 Server/app/resources/users/Users.jl create mode 100644 Server/app/resources/users/UsersValidator.jl create mode 100644 Server/app/svelte/public/css/auth.css create mode 100644 Server/app/svelte/public/css/profile.css create mode 100644 Server/app/svelte/public/js/libraries/authTools.js create mode 100644 Server/app/svelte/src/auth/auth-component.svelte create mode 100644 Server/app/svelte/src/auth/confirmation-component.svelte create mode 100644 Server/app/svelte/src/auth/login-component.svelte create mode 100644 Server/app/svelte/src/auth/signup-component.svelte create mode 100644 Server/app/svelte/src/navbar/navbar-logged.svelte rename Server/app/svelte/src/navbar/{navbar-component.svelte => navbar-not-logged.svelte} (98%) create mode 100644 Server/app/svelte/src/profile/profile-communes.svelte create mode 100644 Server/app/svelte/src/profile/profile-component.svelte create mode 100644 Server/app/svelte/src/profile/profile-coops.svelte create mode 100644 Server/app/svelte/src/profile/profile-general.svelte create mode 100644 Server/app/svelte/src/profile/profile-groups.svelte create mode 100644 Server/app/svelte/src/profile/profile-parties.svelte rename Server/db/migrations/{2022026611846567_create_table_communes.jl => 2022026611846566_create_table_communes.jl} (100%) rename Server/db/migrations/{2022026611846570_create_table_cooperatives.jl => 2022026611846567_create_table_cooperatives.jl} (94%) rename Server/db/migrations/{2022026611846571_create_table_partners.jl => 2022026611846568_create_table_partners.jl} (100%) create mode 100644 Server/db/migrations/2022026611846569_create_table_groups_requests.jl rename Server/db/migrations/{2022026611846568_create_table_communes_requests.jl => 2022026611846570_create_table_communes_requests.jl} (100%) rename Server/db/migrations/{2022026611846566_create_table_groups_requests.jl => 2022026611846571_create_table_coops_requests.jl} (100%) rename Server/db/migrations/{2022026611846569_create_table_parties_requests.jl => 2022026611846572_create_table_parties_requests.jl} (100%) create mode 100644 Server/db/migrations/2022026611846573_create_table_groups_users.jl create mode 100644 Server/db/migrations/2022026611846574_create_table_communes_users.jl create mode 100644 Server/db/migrations/2022026611846575_create_table_cooperatives_users.jl create mode 100644 Server/db/migrations/2022026611846576_create_table_parties_users.jl create mode 100644 Server/lib/Cookies.jl create mode 100644 Server/lib/EmailSupport/EmailSupport.jl create mode 100644 Server/lib/EmailSupport/credentials.json create mode 100644 Server/plugins/genie_authentication.jl create mode 100644 Server/public/css/auth.css create mode 100644 Server/public/css/profile.css create mode 100644 Server/public/img/auth/eye_icon.svg create mode 100644 Server/public/img/auth/facebook_icon.svg create mode 100644 Server/public/img/auth/google_icon.svg create mode 100644 Server/public/img/auth/linkedin_icon.svg create mode 100644 Server/public/img/profile/icons/general.svg create mode 100644 Server/public/img/profile/icons/logout.svg create mode 100644 Server/public/img/profile/icons/pencil.svg create mode 100644 Server/public/img/profile/profile_pictures/fierce_bunny.svg create mode 100644 Server/public/img/profile/profile_pictures/majestic_tiger.svg create mode 100644 Server/public/js/components/auth-component.js create mode 100644 Server/public/js/components/confirmation-component.js create mode 100644 Server/public/js/components/index-122ecbb4.js create mode 100644 Server/public/js/components/index-6b4fe380.js create mode 100644 Server/public/js/components/index-998178c7.js create mode 100644 Server/public/js/components/index-ee911aff.js create mode 100644 Server/public/js/components/index-f9998ce7.js create mode 100644 Server/public/js/components/index-fb9750f3.js create mode 100644 Server/public/js/components/login-component.js create mode 100644 Server/public/js/components/navbar-logged.js create mode 100644 Server/public/js/components/navbar-not-logged.js create mode 100644 Server/public/js/components/profile-component.js create mode 100644 Server/public/js/components/profile-general.js create mode 100644 Server/public/js/components/profile-group.js create mode 100644 Server/public/js/components/profile-groups.js create mode 100644 Server/public/js/components/profile-my-details.js create mode 100644 Server/public/js/components/signup-component.js create mode 100644 Server/public/js/libraries/authTools.js diff --git a/Server/Manifest.toml b/Server/Manifest.toml index a51ec85..cbc5a56 100644 --- a/Server/Manifest.toml +++ b/Server/Manifest.toml @@ -1,8 +1,8 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.9.0" +julia_version = "1.9.1" manifest_format = "2.0" -project_hash = "829f3e210629ef04542eb44fc4cb5acdb74d23eb" +project_hash = "09d33216e2516631ede3cbab2af65d3f95eb0598" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] @@ -62,9 +62,9 @@ version = "1.3.1" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "9c209fb7536406834aa938fb149964b985de6c83" +git-tree-sha1 = "02aa26a4cf76381be7f66e020a3eddeb27b0a092" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.1" +version = "0.7.2" [[deps.CommonMark]] deps = ["Crayons", "JSON", "PrecompileTools", "URIs"] @@ -74,9 +74,9 @@ version = "0.8.12" [[deps.Compat]] deps = ["UUIDs"] -git-tree-sha1 = "4e88377ae7ebeaf29a047aa1ee40826e0b708a5d" +git-tree-sha1 = "5ce999a19f4ca23ea484e92a1774a61b8ca4cf8e" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.7.0" +version = "4.8.0" weakdeps = ["Dates", "LinearAlgebra"] [deps.Compat.extensions] @@ -89,31 +89,36 @@ version = "1.0.2+0" [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] -git-tree-sha1 = "96d823b94ba8d187a6d8f0826e731195a74b90e9" +git-tree-sha1 = "5372dbbf8f0bdb8c700db5367132925c0771ef7e" uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" -version = "2.2.0" +version = "2.2.1" [[deps.Crayons]] git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" version = "4.1.1" +[[deps.DBInterface]] +git-tree-sha1 = "9b0dc525a052b9269ccc5f7f04d5b3639c65bca5" +uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965" +version = "2.5.0" + [[deps.DataAPI]] git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" version = "1.15.0" [[deps.DataFrames]] -deps = ["Compat", "DataAPI", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] -git-tree-sha1 = "aa51303df86f8626a962fccb878430cdb0a97eee" +deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "04c738083f29f86e62c8afc341f0967d8717bdb8" uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" -version = "1.5.0" +version = "1.6.1" [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0" +git-tree-sha1 = "cf25ccb972fec4e4817764d01c82386ae94f77b4" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.13" +version = "0.18.14" [[deps.DataValueInterfaces]] git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" @@ -168,9 +173,9 @@ uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" version = "0.1.9" [[deps.ExprTools]] -git-tree-sha1 = "c1d06d129da9f55715c6c212866f5b1bddc5fa00" +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" -version = "0.1.9" +version = "0.1.10" [[deps.EzXML]] deps = ["Printf", "XML2_jll"] @@ -193,12 +198,6 @@ version = "0.9.20" [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" -[[deps.Formatting]] -deps = ["Printf"] -git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" -uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" -version = "0.4.2" - [[deps.Future]] deps = ["Random"] uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" @@ -257,9 +256,9 @@ version = "1.3.1" [[deps.HTTP]] deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "2613d054b0e18a3dea99ca1594e9a3960e025da4" +git-tree-sha1 = "cb56ccdd481c0dd7f975ad2b3b62d9eda088f7e2" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.9.7" +version = "1.9.14" [[deps.HttpCommon]] deps = ["Dates", "Nullables", "Test", "URIParser"] @@ -339,6 +338,12 @@ git-tree-sha1 = "5b62d93f2582b09e469b3099d839c2d2ebf5066d" uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" version = "1.13.1" +[[deps.JWTs]] +deps = ["Base64", "Downloads", "JSON", "MbedTLS", "Random"] +git-tree-sha1 = "a1f3ded6307ef85cc18dec93d9b993814eb4c1a0" +uuid = "d850fbd6-035d-5a70-a269-1ca2e636ac6c" +version = "0.2.2" + [[deps.JuliaFormatter]] deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "PrecompileTools", "Tokenize"] git-tree-sha1 = "60567b51bd9e1e19ae2fd8a54dcd6bc5994727f0" @@ -386,10 +391,10 @@ deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibPQ]] -deps = ["CEnum", "Dates", "Decimals", "DocStringExtensions", "FileWatching", "Infinity", "Intervals", "IterTools", "LayerDicts", "LibPQ_jll", "Libdl", "Memento", "OffsetArrays", "SQLStrings", "Tables", "TimeZones", "UTCDateTimes"] -git-tree-sha1 = "114d9d239ab8e1251354ad6bb97ed38622133114" +deps = ["CEnum", "DBInterface", "Dates", "Decimals", "DocStringExtensions", "FileWatching", "Infinity", "Intervals", "IterTools", "LayerDicts", "LibPQ_jll", "Libdl", "Memento", "OffsetArrays", "SQLStrings", "Tables", "TimeZones", "UTCDateTimes"] +git-tree-sha1 = "d8967f68674aa9ad4b9b3df114e3842f269ac147" uuid = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" -version = "1.15.1" +version = "1.16.0" [[deps.LibPQ_jll]] deps = ["Artifacts", "JLLWrappers", "Kerberos_krb5_jll", "Libdl", "OpenSSL_jll", "Pkg"] @@ -519,9 +524,9 @@ version = "1.0.0" [[deps.OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "82d7c9e310fe55aa54996e6f7f94674e2a38fcb4" +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.9" +version = "1.12.10" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] @@ -552,9 +557,9 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.5+0" [[deps.OrderedCollections]] -git-tree-sha1 = "d321bf2de576bf25ec4d3e4360faca399afca282" +git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.6.0" +version = "1.6.2" [[deps.Parameters]] deps = ["OrderedCollections", "UnPack"] @@ -564,9 +569,9 @@ version = "0.12.3" [[deps.Parsers]] deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "4b2e829ee66d4218e0cef22c0a64ee37cf258c29" +git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.7.1" +version = "2.7.2" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] @@ -608,10 +613,10 @@ uuid = "21216c6a-2e73-6563-6e65-726566657250" version = "1.4.0" [[deps.PrettyTables]] -deps = ["Crayons", "Formatting", "LaTeXStrings", "Markdown", "Reexport", "StringManipulation", "Tables"] -git-tree-sha1 = "213579618ec1f42dea7dd637a42785a608b1ea9c" +deps = ["Crayons", "LaTeXStrings", "Markdown", "Printf", "Reexport", "StringManipulation", "Tables"] +git-tree-sha1 = "ee094908d720185ddbdc58dbe0c1cbe35453ec7a" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -version = "2.2.4" +version = "2.2.7" [[deps.Printf]] deps = ["Unicode"] @@ -701,12 +706,6 @@ git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" version = "1.1.0" -[[deps.SnoopPrecompile]] -deps = ["Preferences"] -git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" -uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" -version = "1.0.3" - [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -739,9 +738,9 @@ version = "1.9.0" [[deps.StringEncodings]] deps = ["Libiconv_jll"] -git-tree-sha1 = "33c0da881af3248dafefb939a21694b97cfece76" +git-tree-sha1 = "b765e46ba27ecf6b44faf70df40c57aa3a547dcb" uuid = "69024149-9ee7-55f6-a4c4-859efe599b68" -version = "0.3.6" +version = "0.3.7" [[deps.StringManipulation]] git-tree-sha1 = "46da2434b41f41ac3594ee9816ce5541c6096123" @@ -765,10 +764,10 @@ uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" version = "1.0.3" [[deps.TableShowUtils]] -deps = ["DataValues", "Dates", "JSON", "Markdown", "Test"] -git-tree-sha1 = "14c54e1e96431fb87f0d2f5983f090f1b9d06457" +deps = ["DataValues", "Dates", "JSON", "Markdown", "Unicode"] +git-tree-sha1 = "2a41a3dedda21ed1184a47caab56ed9304e9a038" uuid = "5e66a065-1f0a-5976-b372-e0b8c017ca10" -version = "0.2.5" +version = "0.2.6" [[deps.TableTraits]] deps = ["IteratorInterfaceExtensions"] @@ -810,9 +809,9 @@ version = "1.0.1" [[deps.TimeZones]] deps = ["Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "Unicode"] -git-tree-sha1 = "cdaa0c2a4449724aded839550eca7d7240bb6938" +git-tree-sha1 = "5b347464bdac31eccfdbe1504d9484c31645cafc" uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" -version = "1.10.0" +version = "1.11.0" [[deps.Tokenize]] git-tree-sha1 = "90538bf898832b6ebd900fa40f223e695970e3a5" @@ -880,7 +879,7 @@ version = "1.2.13+0" [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.7.0+0" +version = "5.8.0+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] diff --git a/Server/Project.toml b/Server/Project.toml index d7fe3a6..5c8b37e 100644 --- a/Server/Project.toml +++ b/Server/Project.toml @@ -4,6 +4,7 @@ authors = ["a-ill "] version = "0.1.0" [deps] +Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -15,6 +16,7 @@ GenieSession = "03cc5b98-4f21-4eb6-99f2-22eced81f962" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" Inflector = "6d011eab-0732-4556-8808-e463c76bf3b6" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +JWTs = "d850fbd6-035d-5a70-a269-1ca2e636ac6c" LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a" diff --git a/Server/app/layouts/main.jl.html b/Server/app/layouts/main.jl.html index 53ac93e..8aff019 100644 --- a/Server/app/layouts/main.jl.html +++ b/Server/app/layouts/main.jl.html @@ -25,7 +25,11 @@
- + <% if authenticated() %> + + <% else %> + + <% end %> <%@yield%> diff --git a/Server/app/resources/authentication/AuthenticationController.jl b/Server/app/resources/authentication/AuthenticationController.jl new file mode 100644 index 0000000..45d7f43 --- /dev/null +++ b/Server/app/resources/authentication/AuthenticationController.jl @@ -0,0 +1,193 @@ +module AuthenticationController + +using Genie, Genie.Requests, Genie.Renderer, Genie.Renderer.Json, Genie.Renderer.Html, GenieSession, SearchLight, GenieAuthentication, GenieAuthorisation +using Logging +using JSON3, Random, Base64, HTTP, Dates +using Server.Users, Server.EmailSupport, Server.TemplateEditor, Server.Cookies, Server.DatabaseSupport +import Server.TemplateEditor.generate_layout_html +import Server.DatabaseSupport.select_from_table +using JWTs + +#---Helpers---------------------------------------------------------- + +const keyset = JWKSet("https://www.googleapis.com/oauth2/v3/certs") +refresh!(keyset) + +current_user() = findone(Users.User, id = get_authentication()) + +function send_signup_confirmation_email(receiver,confirmation_code) + subject,message = ["Sign-up confirmation","Hello!\r\nYour confirmation code is "*confirmation_code*"\r\n"] + message = "Content-Type: text/html\r\n"*message + return send_email(receiver,subject,message) +end + +function register_google() + jws = rawpayload() + jws_split = split(jws,".") + payload_encoded = jws_split[2] + rem = length(payload_encoded)%4 + if rem!= 0 + payload_encoded = payload_encoded* "="^(4-rem) + end + payload = String(base64decode(payload_encoded)) + json = JSON3.read(payload) + sub = json[:sub] + email = json[:email] + user = findone(User, email = email) + if isnothing(user) + # ENABLE WHEN IN PRODUCTION + user = User(email = email,google_id = sub) |> save! + authenticate(user.id, GenieSession.session(params())) + assign_role(user, findone(Role, name = "free")) + save(user) + return true + return 0 + else + jwt = JWT(payload="") + jwt.header = jws_split[1] + jwt.payload = jws_split[2] + jwt.signature = jws_split[3] + if validate!(jwt, keyset) + if user.google_id=="" + user.google_id = sub + save(user) + authenticate(user.id, GenieSession.session(params())) + return 3 + elseif user.google_id==sub + authenticate(user.id, GenieSession.session(params())) + return 3 + else + return 0 + end + else + return 0 + end + end +end + +function get_locale() + data = payload() + if :locale in keys(data) + return data[:locale] + else + return "en" + end +end + +const auth_info = Dict( + "en" => Dict( + :title => "LibSoc - Login/Sign Up", + :description => "" + ), + "ru" => Dict( + :title => "LibSoc - Логин/Регистрация", + :description => "" + ) +) + + +#---Routing functions--------------------------------------------------- + +controller = "authentication" +const dict_layouts = Dict( + :auth => generate_layout_html("main",controller,"auth",libraries=["GoogleAuth"]), + :profile => generate_layout_html("main",controller,"profile"), + :email_confirmation => generate_layout_html("main",controller,"email_confirmation"), +) + +function auth() + locale = get_locale() + set_cookies(params()) + html(:authentication,:auth, layout = dict_layouts[:auth], context = @__MODULE__, + title = auth_info[locale][:title], + description = auth_info[locale][:description] + ) +end + +function profile() + set_cookies(params()) + html(:authentication,:profile, layout = dict_layouts[:profile], context = @__MODULE__, + title = "Chiron | Profile", + description = "" + ) +end + +function email_confirmation() + set_cookies(params()) + html(:authentication,:email_confirmation, layout = dict_layouts[:email_confirmation], context = @__MODULE__, + title = "Chiron | Email Confirmation", + description = "" + ) +end + +function confirm_email() + code = rawpayload() + user = current_user() + if code==user.confirmation_code + GenieAuthorisation.Relationship!(user, findone(Role, name = "unconfirmed")) |> delete + assign_role(user, findone(Role, name = "free")) + return true + else + return false + end +end + +function register() + data = jsonpayload() + user = findone(User, email = data["email"]) + if isnothing(user) + user = User(email = data["email"], + password = data["password"] |> Users.hash_password, + ) |> save! + authenticate(user.id, GenieSession.session(params())) + assign_role(user, findone(Role, name = "free")) + confirmation_code = randstring('0':'9', 5) + user.confirmation_code = confirmation_code + save(user) + #send_signup_confirmation_email(data["email"],confirmation_code) + return true + else + return false + end +end + +function login() + data = jsonpayload() + user = findone(User, email = data["email"]) + if isnothing(user) + return 0 + else + if (user.password==Users.hash_password(data["password"])) + authenticate(user.id, GenieSession.session(params())) + return 2 + else + return 1 + end + end +end + +function logout() + deauthenticate(GenieSession.session(params())) + return +end + +function change_user() + data = jsonpayload() + user = findone(Users.User, id = get_authentication()) + for (field,value) in data + setfield!(user, Symbol(field), value) + end + save(user) + return JSON3.write(true) +end + +function get_user() + try + user = findone(Users.User, id = get_authentication()) + return JSON3.write(user) + catch ex + return JSON3.write(false) + end +end + +end \ No newline at end of file diff --git a/Server/app/resources/authentication/views/auth.jl.html b/Server/app/resources/authentication/views/auth.jl.html new file mode 100644 index 0000000..8b47a21 --- /dev/null +++ b/Server/app/resources/authentication/views/auth.jl.html @@ -0,0 +1,2 @@ + + diff --git a/Server/app/resources/authentication/views/email_confirmation.jl.html b/Server/app/resources/authentication/views/email_confirmation.jl.html new file mode 100644 index 0000000..c065ffd --- /dev/null +++ b/Server/app/resources/authentication/views/email_confirmation.jl.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Server/app/resources/authentication/views/profile.jl.html b/Server/app/resources/authentication/views/profile.jl.html new file mode 100644 index 0000000..2f72e3d --- /dev/null +++ b/Server/app/resources/authentication/views/profile.jl.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Server/app/resources/basic/BasicController.jl b/Server/app/resources/basic/BasicController.jl index 8b42e34..0936a62 100644 --- a/Server/app/resources/basic/BasicController.jl +++ b/Server/app/resources/basic/BasicController.jl @@ -1,6 +1,6 @@ module BasicController -using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests +using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication using JSON3 using SearchLight using Server.DatabaseSupport, Server.TemplateEditor diff --git a/Server/app/resources/communes/CommunesController.jl b/Server/app/resources/communes/CommunesController.jl index 613ffc6..f888c5c 100644 --- a/Server/app/resources/communes/CommunesController.jl +++ b/Server/app/resources/communes/CommunesController.jl @@ -1,6 +1,6 @@ module CommunesController -using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests +using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication using JSON3 using SearchLight using Server.DatabaseSupport, Server.TemplateEditor diff --git a/Server/app/resources/cooperatives/CooperativesController.jl b/Server/app/resources/cooperatives/CooperativesController.jl index 8c08482..1e763d3 100644 --- a/Server/app/resources/cooperatives/CooperativesController.jl +++ b/Server/app/resources/cooperatives/CooperativesController.jl @@ -1,6 +1,6 @@ module CooperativesController -using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests +using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication using JSON3 using SearchLight using Server.DatabaseSupport, Server.TemplateEditor diff --git a/Server/app/resources/groups/GroupsController.jl b/Server/app/resources/groups/GroupsController.jl index c924959..bf2432a 100644 --- a/Server/app/resources/groups/GroupsController.jl +++ b/Server/app/resources/groups/GroupsController.jl @@ -1,9 +1,10 @@ module GroupsController -using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests +using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication using JSON3 using SearchLight using Server.DatabaseSupport, Server.TemplateEditor +import Server.DatabaseSupport: select_from_table controller = "groups" dict_layouts = Dict( @@ -56,4 +57,13 @@ function groups_add_post() insert_into_table("groups_requests",data) end +function get_user_groups() + user_id = get_authentication() + data = select_from_table("groups" => ["*"], + where_data = ["user_id" => user_id]) + ns = names(data) + data_dict = map(x -> Dict(zip(ns,values(x))),eachrow(data)) + return JSON3.write(data_dict) +end + end diff --git a/Server/app/resources/parties/PartiesController.jl b/Server/app/resources/parties/PartiesController.jl index 15a0099..4f4b9b5 100644 --- a/Server/app/resources/parties/PartiesController.jl +++ b/Server/app/resources/parties/PartiesController.jl @@ -1,6 +1,6 @@ module PartiesController -using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests +using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication using JSON3 using SearchLight using Server.DatabaseSupport, Server.TemplateEditor diff --git a/Server/app/resources/partners/PartnersController.jl b/Server/app/resources/partners/PartnersController.jl index a553c62..ceadaa0 100644 --- a/Server/app/resources/partners/PartnersController.jl +++ b/Server/app/resources/partners/PartnersController.jl @@ -1,6 +1,6 @@ module PartnersController -using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests +using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication using JSON3 using SearchLight using Server.DatabaseSupport, Server.TemplateEditor diff --git a/Server/app/resources/users/Users.jl b/Server/app/resources/users/Users.jl new file mode 100644 index 0000000..a6e1877 --- /dev/null +++ b/Server/app/resources/users/Users.jl @@ -0,0 +1,29 @@ +module Users + +using SearchLight, SearchLight.Validation, Server.UsersValidator +using SHA +using Random + +export User + +Base.@kwdef mutable struct User <: AbstractModel + ### FIELDS + id::DbId = DbId() + email::String = "" + password::String = "" + google_id::String = "" + confirmation_code::String = "" + verified::Bool = false +end + +Validation.validator(u::Type{User}) = ModelValidator([ + ValidationRule(:email, UsersValidator.not_empty), + ValidationRule(:email, UsersValidator.unique), + ValidationRule(:password, UsersValidator.not_empty) +]) + +function hash_password(password::String) + sha256(password) |> bytes2hex +end + +end \ No newline at end of file diff --git a/Server/app/resources/users/UsersValidator.jl b/Server/app/resources/users/UsersValidator.jl new file mode 100644 index 0000000..d732b24 --- /dev/null +++ b/Server/app/resources/users/UsersValidator.jl @@ -0,0 +1,21 @@ +module UsersValidator + +using SearchLight, SearchLight.Validation, SearchLight.QueryBuilder + +function not_empty(field::Symbol, m::T, args::Vararg{Any})::ValidationResult where {T<:AbstractModel} + isempty(getfield(m, field)) && return ValidationResult(invalid, :not_empty, "should not be empty") + + ValidationResult(valid) +end + +function unique(field::Symbol, m::T, args::Vararg{Any})::ValidationResult where {T<:AbstractModel} + ispersisted(m) && return ValidationResult(valid) # don't validate updates + + if SearchLight.count(typeof(m), where("$field = ?", getfield(m, field))) > 0 + return ValidationResult(invalid, :unique, "is already used") + end + + ValidationResult(valid) +end + +end \ No newline at end of file diff --git a/Server/app/svelte/public/css/auth.css b/Server/app/svelte/public/css/auth.css new file mode 100644 index 0000000..e619dd9 --- /dev/null +++ b/Server/app/svelte/public/css/auth.css @@ -0,0 +1,171 @@ + +label { + font-size: 1.3rem; + font-family: var(--sans-serif); +} + +.auth-pane { + position: relative; + padding: 3.4rem; + padding-top: 3.4rem; + padding-bottom: 3.4rem; + width: 30rem; + height: auto; +} + +.auth-title { + position: relative; + top: 0.2rem; + margin-bottom: 2.7rem; +} + +.auth-label { + display: inline-block; + margin-bottom: 0.3rem; +} + +.authEmailInput, .authPasswordInput { + position: relative; + width: 100%; + border-radius: 0.34rem; + color: #353535; + height: 2.73rem; + padding-left: 0.34rem; +} + +.authEmailInput { + margin-bottom: 0.682rem; +} + +.auth-button { + margin-top: 1.365rem; + height: 3.412rem; + width: 100%; + font-family: var(--sans-serif,sans-serif); + font-size: 1.3rem; + color: white; + background-color: var(--red); + border-color: var(--red); + border-radius: 0.512rem; + filter: drop-shadow(0.068rem 0.136rem 0.068rem rgb(0 0 0 / 0.4)); +} + +.auth-button:active { + background-color: var(--darker-pink); +} + +#email-msg,#password-msg { + display: inline; + color:red; + font-family: var(--sans-serif,sans-serif); +} + +.auth-line { + margin-top: 1.5rem; + width: 100%; + height: 0.07rem; + border: 0; + border-radius: 0.1rem; + background: black; +} + +.auth-methods-group { + display: grid; + grid-template-columns: auto ; /*auto auto*/ + justify-content: center; + gap: 2.7rem; + margin-top: 2rem; +} + +.auth-methods-group img { + height: auto; + width: 3.4rem; +} + +.auth-methods-group> div { + position: relative; + border-radius: 6.8rem; + width: 3.4rem; + height: 3.4rem; + overflow: hidden; +} + +#google-btn { + position: absolute; + top: -0.8rem; + left: -0.8rem; +} + +#google-logo { + position: relative; + background: white; + pointer-events: none; +} + +#google-btn-wrapper { + cursor: pointer; +} + +#google-btn div { + position: absolute; + height: 5rem; + width: 5rem; +} + +#google-btn iframe { + position: absolute; + height: 10rem; + width: 10rem; +} + +.password-field { + position: relative; +} + +.eye-icon { + display: block; + position: absolute; + cursor: pointer; + opacity: 0.25; + top: 2.6rem; + right: 0.8rem; + width: 1.7rem; +} + +.eye-icon * { + pointer-events: none; +} + +#forgot-password { + display: block; + position: relative; + margin-top: 0.5rem; + height: 2rem; + color:#5f5f5f; + margin-left: auto; + width: max-content; + font-family: var(--sans-serif); + font-size: 1.3rem; +} + + +#remember-me { + position: relative; + display: flex; + align-items: center; + margin-top: 1rem; + gap: 1rem; +} + +#remember-me-checkbox { + min-height: 1.5rem; + min-width: 1.5rem; + flex: 0; + accent-color: var(--gray); +} + +#remember-me label { + position: relative; + margin-top: -0.2rem; + color: #5f5f5f; +} diff --git a/Server/app/svelte/public/css/common.css b/Server/app/svelte/public/css/common.css index 4920c69..6bf030b 100644 --- a/Server/app/svelte/public/css/common.css +++ b/Server/app/svelte/public/css/common.css @@ -1,21 +1,7 @@ :root { - --light-blue:hsl(195, 67%, 95%); - --darker-pink:hsl(344, 60%, 47%); - --pink:hsl(344, 73%, 57%); - --dark-green:hsl(176, 63%, 25%); - --green:hsl(147, 33%, 60%); - --orange:hsl(30, 97%, 72%); - --light-orange: hsl(19, 76%, 72%); - --dark-brown:hsl(23, 47%, 20%); - --brown:hsl(23, 47%, 30%); - --light-brown: hsl(23, 47%, 50%); - --dark-pink:hsl(343, 39%, 16%); - --red:hsl(359, 72%, 61%); - --dark-blue:hsl(217, 25%, 16%); - --grey-blue:hsl(223, 13%, 22%); - --cream:hsl(34, 43%, 90%); - --dark-cream:hsl(33, 26%, 84%); + --red:#c52a28; + --gray: #5B6970; --sans-serif: "OpenSans"; --serif: "Lora"; } @@ -48,12 +34,10 @@ body { #content { position: relative; - display: flex; - flex-direction: column; - justify-content: space-between; + display: grid; + grid-template-rows: max-content auto max-content; height: 100%; min-height: 100vh; - flex-grow: 1; } /*---Fonts---------------------------------------------------------*/ @@ -475,9 +459,8 @@ input[type=number]::-webkit-outer-spin-button { .pane { background: white; - border: 0; + border: 0.1rem solid rgb(187, 187, 187); border-radius: 0.635rem; - box-shadow: 0 0 0.314rem rgb(187, 187, 187); } .pane-container { diff --git a/Server/app/svelte/public/css/profile.css b/Server/app/svelte/public/css/profile.css new file mode 100644 index 0000000..32ba0ec --- /dev/null +++ b/Server/app/svelte/public/css/profile.css @@ -0,0 +1,55 @@ + + + + +/* + +#notifications-div>button { + cursor: pointer; + margin-left: 0.341rem; +} + +#notifications-div>:nth-child(1) { + width: 1.706rem; + height: 1.706rem; + background-color: #ccc; + border-radius: 100%; +} + +#notifications-div>:nth-child(2) { + width: 2.047rem; + height: 2.047rem; + background-color: #ccc; + border-radius: 100%; +} + +#notifications-div>:nth-child(3) { + width: 2.389rem; + height: 2.389rem; + background-color: #ccc; + border-radius: 100%; +} + +#notifications-div>button>div { + cursor: pointer; + margin: auto; + background-color: white; + border-radius: 100%; +} + +#notifications-div>:nth-child(1)>div { + width: 1.228rem; + height: 1.228rem; +} + +#notifications-div>:nth-child(2)>div { + width: 1.57rem; + height: 1.57rem; +} + +#notifications-div>:nth-child(3)>div { + width: 1.843rem; + height: 1.843rem; +} + +*/ \ No newline at end of file diff --git a/Server/app/svelte/public/js/libraries/authTools.js b/Server/app/svelte/public/js/libraries/authTools.js new file mode 100644 index 0000000..c1b98d0 --- /dev/null +++ b/Server/app/svelte/public/js/libraries/authTools.js @@ -0,0 +1,160 @@ + +import {getData, sendData} from "/js/libraries/serverTools.js" + +export function getUser(user,callbackOuter) { + let callback = function(response) { + Object.assign(user,JSON.parse(response)) + if(callbackOuter!=undefined) { + callbackOuter() + } + } + getData("/xx/get-user",callback) +} + +export function changeUser(name,value,user) { + if (user[name]!=value && user[name]!=undefined) { + user[name] = value + let data = new Object(); + data[name] = value + sendData("/xx/change-user",data) + } +} + +export function changePasswordVisibility(button) { + let input = button.previousElementSibling + let type = input.type + if (type=="text") { + input.type = "password"; + button.style.opacity = 0.25 + } + else { + input.type = "text"; + button.style.opacity = 1 + } +} + +export function checkEmail(email,msg) { + if (email.includes("@")) { + return true + } + else { + msg.innerHTML = "must contain '@'" + return false + } +} + +export function checkPassword(password,msg) { + let passwordLength = password.length + if (passwordLength<8) { + msg.innerHTML = "must be 8 characters" + return false + } + let numNumbers = password.match(/\d/g)?.length || 0; + if (numNumbers<1) { + msg.innerHTML = "mush have digits" + return false + } + let numLetters = password.match(/\D/g)?.length || 0; + if (numLetters<2) { + msg.innerHTML = "must have letters" + return false + } + return true +} + +export function redirectLogged() { + let callback = function(responseText) { + let response = JSON.parse(responseText) + if (response) { + window.location.href = "/"; + } + } + getData("/xx/check-login",callback) +} + +export function redirectNotLogged() { + let callback = function(responseText) { + let response = JSON.parse(responseText) + if (!response) { + window.location.href = "/"; + } + } + getData("/xx/check-login",callback) +} + +// Redirect to the landing page +export function toLandingPage(response) { + if (response!=0) { + window.location.href = "/"; + } +} + +// Redirect to the dashboard page +export function toDashboard() { + window.location.href = "/"; +} + +// Process log in +export function processLoginResponse(response,msgs,remember) { + if (response==0) { + msgs.email.innerHTML = "not found" + } + else if (response==1) { + msgs.password.innerHTML = "is wrong" + } + else { + if (remember) { + let date = new Date() + date.setMonth(date.getMonth()+1) + date = date.toUTCString() + document.cookie = "__genierememberme=; expires=" + date + "; path=/;SameSite=Lax"; + } + toDashboard() + } +} + +// Log in +export function login(msgs,inputs) { + msgs.email.innerHTML = "" + msgs.password.innerHTML = "" + let data = {email: inputs.email.value, password: inputs.password.value, remember: inputs.remember.checked} + sendData('/xx/login-post', data, (response) => processLoginResponse(response,msgs,inputs.remember.checked)) +} + +// Process sign in +function processSignupResponse(response,msgs) { + if (response) { + toDashboard() + } + else { + msgs.email.innerHTML = "already exists" + } +} + +// Sign up +export function signup(msgs,inputs) { + msgs.email.innerHTML = "" + let email = inputs.email.value + let password = inputs.password.value + if (checkEmail(email,msgs.email)==false) { + return + } + if (checkPassword(password,msgs.password)==false) { + return + } + let data = {email: email, password: password} + sendData('/xx/signup-post', data, (response) => processSignupResponse(response,msgs)) +} + +export function confirmEmail(msg,code,callback) { + msg.innerHTML = "" + sendData('xx/confirm-email',code,callback) +} + +// Log out +export function logout() { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open( "GET", "/logout", false ); // false for synchronous request + xmlHttp.send( null ); + window.location.href = "/"; +} \ No newline at end of file diff --git a/Server/app/svelte/public/locales/en/navbar-component.json b/Server/app/svelte/public/locales/en/navbar-component.json index d4e3eda..68b400b 100644 --- a/Server/app/svelte/public/locales/en/navbar-component.json +++ b/Server/app/svelte/public/locales/en/navbar-component.json @@ -7,5 +7,7 @@ "communes": "Communes", "cooperatives": "Cooperatives", "parties": "Parties", - "partners": "Partners" + "partners": "Partners", + "login": "Login", + "profile": "Profile" } \ No newline at end of file diff --git a/Server/app/svelte/rollup.config.js b/Server/app/svelte/rollup.config.js index d9f00c2..bade40b 100644 --- a/Server/app/svelte/rollup.config.js +++ b/Server/app/svelte/rollup.config.js @@ -10,6 +10,7 @@ import watch from "rollup-plugin-watch"; const production = !process.env.ROLLUP_WATCH; + function serve() { let server; diff --git a/Server/app/svelte/src/auth/auth-component.svelte b/Server/app/svelte/src/auth/auth-component.svelte new file mode 100644 index 0000000..8d4013d --- /dev/null +++ b/Server/app/svelte/src/auth/auth-component.svelte @@ -0,0 +1,128 @@ + + + + +
+
+ switchFocus(loginComponent)} on:keydown={() => ""}> + switchFocus(signupComponent)} on:keydown={() => ""}> +
+
+ OR +
+
+ + \ No newline at end of file diff --git a/Server/app/svelte/src/auth/confirmation-component.svelte b/Server/app/svelte/src/auth/confirmation-component.svelte new file mode 100644 index 0000000..ebcf43b --- /dev/null +++ b/Server/app/svelte/src/auth/confirmation-component.svelte @@ -0,0 +1,131 @@ + + + + +
+

CONFIRMATION CODE

+
+ onlyNumberKey(0,evt)}>- + onlyNumberKey(1,evt)}>- + onlyNumberKey(2,evt)}>- + onlyNumberKey(3,evt)}>- + onlyNumberKey(4,evt)}> +
+ + +
+ + \ No newline at end of file diff --git a/Server/app/svelte/src/auth/login-component.svelte b/Server/app/svelte/src/auth/login-component.svelte new file mode 100644 index 0000000..ec5356d --- /dev/null +++ b/Server/app/svelte/src/auth/login-component.svelte @@ -0,0 +1,108 @@ + + + + +
+

LOG IN

+ + +
+ + + +
+
+ +
+ + Forgot password? +
+
+
+
+ +
+ +
+
+ + \ No newline at end of file diff --git a/Server/app/svelte/src/auth/signup-component.svelte b/Server/app/svelte/src/auth/signup-component.svelte new file mode 100644 index 0000000..998bc94 --- /dev/null +++ b/Server/app/svelte/src/auth/signup-component.svelte @@ -0,0 +1,241 @@ + + + + +
+

SIGN UP

+ removeMsg(emailMsg)}> + +
+ + removeMsg(passwordMsg)}> + +
+
+ +
+ +

+
+
+ + +
+
+ +
+ +
+

Registration is closed

+

We are still in the process of opening.

+

Sign up for updates to know when it becomes available:

+
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/Server/app/svelte/src/components/pane-aligner.svelte b/Server/app/svelte/src/components/pane-aligner.svelte index 9ad2771..db7fc19 100644 --- a/Server/app/svelte/src/components/pane-aligner.svelte +++ b/Server/app/svelte/src/components/pane-aligner.svelte @@ -71,17 +71,17 @@