feat: github & google login

This commit is contained in:
Elias Renman
2025-03-20 10:09:57 +01:00
parent 02a35cc555
commit 6361532c1e
23 changed files with 1664 additions and 44 deletions

View File

@@ -10,8 +10,8 @@ pub fn handle_redirect(url: &str) -> Result<Redirect, (Status, &'static str)> {
Ok(Redirect::to(row.destination_url))
}
pub fn handle_upsert(dto: UpsertUrlDto<'_>) -> (Status, &'static str) {
let row = upsert_entry(dto.url, dto.destination_url, dto.ttl);
pub fn handle_upsert(username: &str, dto: UpsertUrlDto<'_>) -> (Status, &'static str) {
let row = upsert_entry(username, dto.url, dto.destination_url, dto.ttl);
if row.is_err() {
return (Status::BadRequest, "Failed to upsert redirect");
}