-
-
Notifications
You must be signed in to change notification settings - Fork 50
Support user login and registration #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amCap1712
wants to merge
27
commits into
oauth-phase-2
Choose a base branch
from
users
base: oauth-phase-2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
fafb366
Support user login and registration
amCap1712 31ce07d
Fix existing tests
amCap1712 39c838c
add user view tests
amCap1712 cb1ef8a
Let admins block and unblock users
amCap1712 84b4cef
remove ide files
amCap1712 4c166c5
feat: improve signup & login page
anshg1214 26e20ec
Refactor conditions modal
MonkeyDo 7b1ea12
fix: forgot password page
anshg1214 9796769
add moderation comments
amCap1712 5313857
add manual email verification and more standard template
amCap1712 d0b79f3
supporter fix
amCap1712 9719e00
minor fixes
amCap1712 51ff574
Fix missing close button BS styles
MonkeyDo 11de8fd
Hide password by default
MonkeyDo 4a58226
Animate and reuse project logo pills
MonkeyDo 94089fd
Review conditions modal, add project logos
MonkeyDo 08f3f9b
Make password hide buttons accessible
MonkeyDo 97b065a
Use AuthCardPasswordInput for all password inputs
MonkeyDo 003106d
Rework signup/login pages UI
MonkeyDo f4d8f41
Block button on login page
MonkeyDo f45d8e9
Block button on singup page
MonkeyDo e6e60f1
Add link to end-user singup from commercial signup pages\
MonkeyDo f0a3e14
Add moderation_log to drop tables script
MonkeyDo 5d01e69
add support for editing username
amCap1712 a3cd03d
split admin sections into Supporter and User Management, added CSRF p…
amCap1712 a733c1c
replace reCAPTCHA with MTCaptcha
amCap1712 da8e04c
use local user table for OAuth instead of MB editors table
amCap1712 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| BEGIN; | ||
|
|
||
| CREATE TABLE "user" ( | ||
| id INTEGER GENERATED BY DEFAULT AS IDENTITY, | ||
| name TEXT NOT NULL, | ||
| password TEXT NOT NULL, | ||
| email TEXT UNIQUE, | ||
| unconfirmed_email TEXT, | ||
| email_confirmed_at TIMESTAMP WITH TIME ZONE, | ||
| member_since TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
| last_login_at TIMESTAMP WITH TIME ZONE, | ||
| last_updated TIMESTAMP WITH TIME ZONE, | ||
| deleted BOOLEAN | ||
| ); | ||
|
|
||
| ALTER TABLE "user" ADD CONSTRAINT user_pkey PRIMARY KEY (id); | ||
|
|
||
| COMMIT; |
10 changes: 10 additions & 0 deletions
10
admin/schema_updates/2024-12-12-link-user-and-supporter-table.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| BEGIN; | ||
|
|
||
| ALTER TABLE supporter ADD COLUMN user_id INTEGER; | ||
| UPDATE supporter SET user_id = musicbrainz_row_id; | ||
|
|
||
| ALTER TABLE supporter ADD CONSTRAINT supporter_user_id_fkey | ||
| FOREIGN KEY (user_id) REFERENCES "user" (id) | ||
| ON UPDATE CASCADE ON DELETE SET NULL; | ||
|
|
||
| COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| CREATE TYPE moderation_action_type AS ENUM ('block', 'unblock'); | ||
|
|
||
| BEGIN; | ||
|
|
||
| ALTER TABLE "user" ADD COLUMN is_blocked BOOLEAN NOT NULL DEFAULT FALSE; | ||
| CREATE TABLE moderation_log ( | ||
| id INTEGER GENERATED BY DEFAULT AS IDENTITY, | ||
| user_id INTEGER NOT NULL, | ||
| moderator_id INTEGER NOT NULL, | ||
| action moderation_action_type NOT NULL, | ||
| reason TEXT NOT NULL, | ||
| timestamp TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() | ||
| ); | ||
| ALTER TABLE moderation_log ADD CONSTRAINT moderation_log_pkey PRIMARY KEY (id); | ||
| ALTER TABLE moderation_log ADD CONSTRAINT moderation_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user" (id); | ||
| ALTER TABLE moderation_log ADD CONSTRAINT moderation_log_moderator_id_fkey FOREIGN KEY (moderator_id) REFERENCES "user" (id); | ||
| CREATE INDEX moderation_log_user_id_idx ON moderation_log (user_id); | ||
|
|
||
| ALTER TABLE "user" ADD COLUMN login_id UUID NOT NULL; | ||
| CREATE UNIQUE INDEX user_login_id_idx ON "user" (login_id); | ||
|
|
||
| COMMIT; |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
admin/schema_updates/2025-09-18-add-moderation-action-types.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TYPE moderation_action_type ADD VALUE 'comment'; | ||
| ALTER TYPE moderation_action_type ADD VALUE 'verify_email'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ALTER TYPE moderation_action_type ADD VALUE 'delete'; | ||
| ALTER TYPE moderation_action_type ADD VALUE 'edit_username'; | ||
|
|
||
| BEGIN; | ||
|
|
||
| CREATE TABLE old_username ( | ||
| id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY, | ||
| username TEXT NOT NULL, | ||
| deleted_at TIMESTAMP NOT NULL DEFAULT NOW() | ||
| ); | ||
|
|
||
| CREATE INDEX old_username_username_idx ON old_username (username); | ||
| CREATE UNIQUE INDEX user_name_unq_idx ON "user" (name); | ||
|
|
||
| COMMIT; |
5 changes: 5 additions & 0 deletions
5
admin/schema_updates/2025-10-14-make-supporter-contact-email-optional.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| BEGIN; | ||
|
|
||
| ALTER TABLE supporter ALTER COLUMN contact_email DROP NOT NULL; | ||
|
|
||
| COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,6 @@ BEGIN; | |
|
|
||
| -- TODO: Add some, if needed. | ||
|
|
||
| CREATE INDEX moderation_log_user_id_idx ON moderation_log (user_id); | ||
|
|
||
| COMMIT; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,19 @@ | ||
| from datetime import timedelta | ||
|
|
||
| # CUSTOM CONFIGURATION | ||
|
|
||
| DEBUG = True # set to False in production mode | ||
|
|
||
| SECRET_KEY = "CHANGE_THIS" | ||
|
|
||
| EMAIL_VERIFICATION_SECRET_KEY = "CHANGE THIS" | ||
| EMAIL_VERIFICATION_EXPIRY = timedelta(hours=24) | ||
| EMAIL_RESET_PASSWORD_EXPIRY = timedelta(hours=24) | ||
|
|
||
| # Bcrypt | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are these config items? Some explanation or a link to possible values would be good. |
||
| BCRYPT_HASH_PREFIX = "2a" | ||
| BCRYPT_LOG_ROUNDS = 12 | ||
|
|
||
| # DATABASE | ||
| SQLALCHEMY_DATABASE_URI = "postgresql://metabrainz:metabrainz@meb_db:5432/metabrainz" | ||
| SQLALCHEMY_MUSICBRAINZ_URI = "" | ||
|
|
@@ -100,9 +110,9 @@ MAIL_FROM_DOMAIN = "metabrainz.org" | |
|
|
||
| DEBUG_TB_INTERCEPT_REDIRECTS = False | ||
|
|
||
| # reCAPTCHA (https://www.google.com/recaptcha/) | ||
| RECAPTCHA_PUBLIC_KEY = "" | ||
| RECAPTCHA_PRIVATE_KEY = "" | ||
| # MTCaptcha (https://www.mtcaptcha.com/) | ||
| MTCAPTCHA_PUBLIC_KEY = "" | ||
| MTCAPTCHA_PRIVATE_KEY = "" | ||
|
|
||
| # List of email addresses | ||
| NOTIFICATION_RECIPIENTS = [ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup?