implement external authentication
This commit is contained in:
parent
fe04530f84
commit
6e4aed3ce9
10 changed files with 160 additions and 13 deletions
|
|
@ -8,6 +8,22 @@ use viendesu_core::{
|
|||
|
||||
use super::status_code;
|
||||
|
||||
#[data]
|
||||
pub struct BeginAuth {
|
||||
pub method: core::AuthoredAuth,
|
||||
}
|
||||
|
||||
impl_req!(BeginAuth => [reqs::begin_auth::Ok; reqs::begin_auth::Err]);
|
||||
status_code::direct!(reqs::begin_auth::Ok => OK);
|
||||
status_code::map!(reqs::begin_auth::Err => []);
|
||||
|
||||
#[data]
|
||||
pub struct FinishAuth {}
|
||||
|
||||
impl_req!(FinishAuth => [reqs::finish_auth::Ok; reqs::finish_auth::Err]);
|
||||
status_code::direct!(reqs::finish_auth::Ok => OK);
|
||||
status_code::map!(reqs::finish_auth::Err => [NoSuchAuthSession]);
|
||||
|
||||
#[data]
|
||||
pub struct CheckAuth {}
|
||||
|
||||
|
|
@ -99,4 +115,5 @@ const _: () = {
|
|||
direct!(AlreadyTaken => BAD_REQUEST);
|
||||
direct!(NotFoundOrCompleted => BAD_REQUEST);
|
||||
direct!(InvalidSignUpToken => BAD_REQUEST);
|
||||
direct!(NoSuchAuthSession => NOT_FOUND);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue