Login flow (#193)
* replace EthicsModal by LoginModal and start binding auth logic
* start implementing login modal + give a try to @auth/sveltekit
using Github oauth as a test
* start custom auth implementation instead of auth.js for consistency with moon-landing
* fetch user data from provider
* add migration from anonymous to user + bind frontend
* add missing auth secret + only migrate conversations for pre-existing users
* remove email scope as it's not needed
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* no need to define .well-known path
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* use env var for hf hub website url
* move sessionId to signature on csrf token exchange
* remove ethic modal check and set default settings on new users
* anonymous users can read only + modal on write tries
* refresh session cookie when existing user signin again rather than use the old one
* allow users to keep using the app without loging-in if env var is not present
* typo
* handle denied login
* do not use a form action for login as there is nothing post-ed
* use requiresUser instead of env var to define login modal or not
* move back to a form action for login so user can't be linked to /login directly
* show login modal even for pre-existing users
* fix logic of account creation/updates
* settings insertOne instead of updateOne
* fix missing userId to settings creation
* fix missing updatedAt when updating settings of pre-existing users
* show login modal for everyone + add comments
* fix login modal condition for both required/not required login
* 🔨
* bring back missing form values in login modal
* refactor default settings spread around to a constant
* missing default settings
* typo
* rename a bunch of things to remove SSO references
* always migrate conversations
* remove unneeded sha256 Node specific function, replace with browser crypto API
* fix typings
* Update src/lib/components/LoginModal.svelte
* use authCondition() in callback
* add logout
* 🐛 Fix signout
cc @Grsmto, because "path" of the cookie should be "/"
* fixup! 🐛 Fix signout
* sign out button ui
* add hf logo in the button
---------
Co-authored-by: Eliott C. <coyotte508@gmail.com>
Co-authored-by: Victor Mustar <victor.mustar@gmail.com>