Registration, login and the admin's create-user call take `email` instead of `username`, and the user object returns `email`. The address is checked for its shape (a plain address, no display name, at most 254 bytes), trimmed, lowercased and unique. Sonda sends no mail and does not verify it. - Migration 0018 renames the users column (and the PostgreSQL index); values are kept, so an account made before keeps its plain name and still logs in with it (login does not check the shape). - Error code username_taken becomes email_taken; the JWT claim is now `email`, so access tokens issued before the upgrade are refused once and clients refresh. - OpenAPI spec, README, the web login form (type email), strings (en, it) and the generated API types follow. Closes #65
5 lines
313 B
SQL
5 lines
313 B
SQL
-- An account is identified by an email address. PostgreSQL flavour of sqlite/0018_users_email.sql:
|
|
-- the column keeps its values, so an account made before addresses were asked for keeps its name.
|
|
|
|
ALTER TABLE users RENAME COLUMN username TO email;
|
|
ALTER INDEX users_username_lower RENAME TO users_email_lower;
|