mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-29 07:58:35 +00:00
Ensure user doesn't exist prior to registration
This commit is contained in:
parent
ebab44e780
commit
a344dd784f
@ -61,6 +61,7 @@
|
|||||||
"Sign Up": "Sign Up",
|
"Sign Up": "Sign Up",
|
||||||
"create_account_link_label": "Create an account",
|
"create_account_link_label": "Create an account",
|
||||||
"sign_up_page_title": "Sign Up",
|
"sign_up_page_title": "Sign Up",
|
||||||
|
"registration_user_id_has_been_taken_error": "User ID has been taken",
|
||||||
"E-mail": "E-mail",
|
"E-mail": "E-mail",
|
||||||
"Preferences": "Preferences",
|
"Preferences": "Preferences",
|
||||||
"preferences_category_player": "Player preferences",
|
"preferences_category_player": "Player preferences",
|
||||||
|
@ -101,6 +101,11 @@ module Invidious::Routes::Login
|
|||||||
return error_template(401, "User ID is a required field")
|
return error_template(401, "User ID is a required field")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Ensure user doesn't exist
|
||||||
|
if Invidious::Database::Users.select(email: email)
|
||||||
|
return error_template(401, "registration_user_id_has_been_taken_error")
|
||||||
|
end
|
||||||
|
|
||||||
if password.nil? || password.empty?
|
if password.nil? || password.empty?
|
||||||
return error_template(401, "Password cannot be empty")
|
return error_template(401, "Password cannot be empty")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user