Add an endpoint for creating an access token for a GitHub login

This commit is contained in:
Nathan Sobo 2021-12-21 13:05:32 -07:00
parent 323e1f7367
commit 61b806e485
3 changed files with 21 additions and 2 deletions

View file

@ -11,6 +11,7 @@ use oauth2::{
TokenResponse as _, TokenUrl,
};
use rand::thread_rng;
use rpc::auth as zed_auth;
use scrypt::{
password_hash::{PasswordHash, PasswordHasher, PasswordVerifier, SaltString},
Scrypt,
@ -19,7 +20,6 @@ use serde::{Deserialize, Serialize};
use std::{borrow::Cow, convert::TryFrom, sync::Arc};
use surf::{StatusCode, Url};
use tide::{log, Error, Server};
use rpc::auth as zed_auth;
static CURRENT_GITHUB_USER: &'static str = "current_github_user";
static GITHUB_AUTH_URL: &'static str = "https://github.com/login/oauth/authorize";