mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-24 09:06:10 +03:00
Merge branch 'jf/invite' of github.com:uqbar-dao/uqbar into jf/invite
This commit is contained in:
commit
59c18ecdbb
@ -84,7 +84,7 @@ pub async fn register(
|
||||
|
||||
async fn handle_get(
|
||||
our_get: Arc<Mutex<Option<Identity>>>,
|
||||
networking_keypair_post: Arc<Mutex<Option<Document>>>
|
||||
networking_keypair_post: Arc<Mutex<Option<Document>>>,
|
||||
) -> Result<impl Reply, Rejection> {
|
||||
// 1. Generate networking keys
|
||||
let (public_key, serialized_networking_keypair) = keygen::generate_networking_key();
|
||||
@ -107,7 +107,6 @@ async fn handle_get(
|
||||
|
||||
// return response containing networking information
|
||||
Ok(warp::reply::json(&our))
|
||||
|
||||
}
|
||||
|
||||
async fn handle_post(
|
||||
@ -117,7 +116,6 @@ async fn handle_post(
|
||||
networking_keypair: Document,
|
||||
_redir_port: u16,
|
||||
) -> Result<impl Reply, Rejection> {
|
||||
|
||||
our.name = info.username;
|
||||
|
||||
let seed = SystemRandom::new();
|
||||
@ -126,7 +124,7 @@ async fn handle_post(
|
||||
|
||||
let token = match generate_jwt(&jwt_secret, our.name.clone()) {
|
||||
Some(token) => token,
|
||||
None => return Err(warp::reject())
|
||||
None => return Err(warp::reject()),
|
||||
};
|
||||
let cookie_value = format!("uqbar-auth_{}={};", &our.name, &token);
|
||||
let ws_cookie_value = format!("uqbar-ws-auth_{}={};", &our.name, &token);
|
||||
@ -143,7 +141,6 @@ async fn handle_post(
|
||||
headers.append(SET_COOKIE, HeaderValue::from_str(&ws_cookie_value).unwrap());
|
||||
|
||||
Ok(response)
|
||||
|
||||
}
|
||||
|
||||
/// Serve the login page, just get a password
|
||||
|
Loading…
Reference in New Issue
Block a user