Update dependencies, disable registration and improve path handling

This commit is contained in:
Cameron Cordes
2021-02-02 13:57:51 -05:00
parent acad71701e
commit f20a8a5842
5 changed files with 328 additions and 291 deletions

View File

@@ -1,10 +1,11 @@
use actix_web::error::ErrorUnauthorized;
use actix_web::{dev, http::header, Error, FromRequest, HttpRequest};
use futures::future::{err, ok, Ready};
use jsonwebtoken::{decode, Algorithm, DecodingKey, Validation};
use serde::{Deserialize, Serialize};
use std::str::FromStr;
use actix_web::{dev, Error, FromRequest, http::header, HttpRequest};
use actix_web::error::ErrorUnauthorized;
use futures::future::{err, ok, Ready};
use jsonwebtoken::{Algorithm, decode, DecodingKey, Validation};
use serde::{Deserialize, Serialize};
#[derive(Serialize)]
pub struct Token<'a> {
pub token: &'a str,
@@ -17,7 +18,7 @@ pub struct Claims {
}
pub fn secret_key() -> String {
dotenv::var("SECRET_KEY").unwrap()
dotenv::var("SECRET_KEY").expect("SECRET_KEY env not set!")
}
impl FromStr for Claims {