-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Authenticate the user when they register, by encoding their ID into a JWT. Currently the signing secret is a constant in source code - before this is production ready, we should generate a random application-wide token on startup. Since the cookie crate uses time instead of chrono, we now have two time crates. At some point we should attempt to only use one.
- Loading branch information
Showing
11 changed files
with
286 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
use crate::config::Config; | ||
use sea_orm::DatabaseConnection; | ||
use snowflake::SnowflakeIdBucket; | ||
use std::sync::Arc; | ||
|
||
#[derive(Clone)] | ||
pub struct AppState { | ||
pub config: Arc<Config>, | ||
pub connection: DatabaseConnection, | ||
pub user_snowflake: SnowflakeIdBucket, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.