Prevent arbitrary admin user creation
This commit is contained in:
parent
6ae55d5cfc
commit
c27ad19499
@ -21,9 +21,10 @@ use crate::users::UserCredentials;
|
||||
pub async fn signup(new_user: User) -> Result<(), ServerFnError> {
|
||||
use crate::users::create_user;
|
||||
|
||||
// Ensure the user has no id
|
||||
// Ensure the user has no id, and is not a self-proclaimed admin
|
||||
let new_user = User {
|
||||
id: None,
|
||||
admin: false,
|
||||
..new_user
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user