feat: return refresh_token in cookie

This commit is contained in:
Radical 2025-05-04 22:13:28 +02:00
parent ebb4286c08
commit 0f897dc0c6
5 changed files with 32 additions and 33 deletions

View file

@ -7,6 +7,7 @@ use std::{
use actix_web::{HttpResponse, Scope, web};
use log::error;
use regex::Regex;
use serde::Serialize;
use sqlx::Postgres;
use uuid::Uuid;
@ -15,6 +16,11 @@ mod refresh;
mod register;
mod revoke;
#[derive(Serialize)]
struct Response {
access_token: String,
}
static EMAIL_REGEX: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"[-A-Za-z0-9!#$%&'*+/=?^_`{|}~]+(?:\.[-A-Za-z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[A-Za-z0-9](?:[-A-Za-z0-9]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[-A-Za-z0-9]*[A-Za-z0-9])?").unwrap()
});