fix: change logout to get request
accidentally left it as a post even though it should've been a get
This commit is contained in:
parent
f3760af1bb
commit
8febba2816
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
use actix_web::{HttpRequest, HttpResponse, post, web};
|
use actix_web::{HttpRequest, HttpResponse, get, web};
|
||||||
use diesel::{ExpressionMethods, delete};
|
use diesel::{ExpressionMethods, delete};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ use crate::{
|
||||||
/// 404 Refresh token is invalid
|
/// 404 Refresh token is invalid
|
||||||
/// 401 Unauthorized (no refresh token found)
|
/// 401 Unauthorized (no refresh token found)
|
||||||
///
|
///
|
||||||
#[post("/logout")]
|
#[get("/logout")]
|
||||||
pub async fn res(req: HttpRequest, data: web::Data<Data>) -> Result<HttpResponse, Error> {
|
pub async fn res(req: HttpRequest, data: web::Data<Data>) -> Result<HttpResponse, Error> {
|
||||||
let mut refresh_token_cookie = req.cookie("refresh_token").ok_or(Error::Unauthorized(
|
let mut refresh_token_cookie = req.cookie("refresh_token").ok_or(Error::Unauthorized(
|
||||||
"request has no refresh token".to_string(),
|
"request has no refresh token".to_string(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue