avam-client and oauth2

This commit is contained in:
2024-10-17 00:56:02 +02:00
parent bfc5cbf624
commit f93eb3c429
50 changed files with 5674 additions and 277 deletions

View File

@@ -3,6 +3,7 @@ use lettre::AsyncTransport;
use crate::domain::api::ports::UserNotifier;
use crate::domain::api::models::user::*;
use crate::BASE_URL;
use super::DangerousLettre;
@@ -10,7 +11,7 @@ impl UserNotifier for DangerousLettre {
async fn user_created(&self, user: &User, token: &ActivationToken) {
let mut context = tera::Context::new();
let url = format!("http://127.0.0.1:3000/auth/activate/{}", token); // Move base url to env
let url = format!("{}/auth/activate/{}", BASE_URL, token); // Move base url to env
context.insert("activate_url", &url);
@@ -28,7 +29,7 @@ impl UserNotifier for DangerousLettre {
async fn forgot_password(&self, user: &User, token: &PasswordResetToken) {
let mut context = tera::Context::new();
let url = format!("http://127.0.0.1:3000/auth/reset/{}", token); // Move base url to env
let url = format!("{}/auth/reset/{}", BASE_URL, token); // Move base url to env
context.insert("reset_url", &url);