Change mutation to quickly test if a user is connected or not
This commit is contained in:
parent
05ca82c4e1
commit
e522f358e5
@ -5,28 +5,12 @@ pub struct Mutation;
|
|||||||
#[juniper::graphql_object(Context = Context)]
|
#[juniper::graphql_object(Context = Context)]
|
||||||
impl Mutation {
|
impl Mutation {
|
||||||
fn api_version(
|
fn api_version(
|
||||||
session_id: Option<String>,
|
|
||||||
user_id: Option<String>,
|
|
||||||
context: &Context,
|
context: &Context,
|
||||||
) -> String {
|
) -> String {
|
||||||
"0.1".into()
|
if context.user_auth {
|
||||||
// if session_id.is_some() && user_id.is_some() {
|
"0.1 (authentified)"
|
||||||
// match context
|
} else {
|
||||||
// .appwrite
|
"0.1 (not authentified)"
|
||||||
// .check_session(session_id.unwrap(), user_id.unwrap())
|
}.into()
|
||||||
// {
|
|
||||||
// Ok(true) => "0.1 (authentified)".into(),
|
|
||||||
// Ok(false) => "0.1 (not authentified)".into(),
|
|
||||||
// Err(e) => {
|
|
||||||
// info!(
|
|
||||||
// "Error while checking if the user is connected: {:?}",
|
|
||||||
// e
|
|
||||||
// );
|
|
||||||
// "0.1 (auth failed)"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// "0.1 (not authentified)"
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user