Administrator privileges to get and delete subscribers
This commit is contained in:
@@ -48,7 +48,7 @@ pub async fn post_login(
|
||||
password: form.password,
|
||||
};
|
||||
tracing::Span::current().record("username", tracing::field::display(&credentials.username));
|
||||
let user_id = validate_credentials(credentials, &connection_pool).await?;
|
||||
let (user_id, role) = validate_credentials(credentials, &connection_pool).await?;
|
||||
tracing::Span::current().record("user_id", tracing::field::display(&user_id));
|
||||
|
||||
session.renew().await.context("Failed to renew session.")?;
|
||||
@@ -60,6 +60,10 @@ pub async fn post_login(
|
||||
.insert_username(form.username)
|
||||
.await
|
||||
.context("Failed to insert username in session data store.")?;
|
||||
session
|
||||
.insert_role(role)
|
||||
.await
|
||||
.context("Failed to insert role in session data store.")?;
|
||||
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert("HX-Redirect", "/admin/dashboard".parse().unwrap());
|
||||
|
||||
Reference in New Issue
Block a user