Refactor comments and update session identity logic
Revised comments for clarity in main.rs and session_identify.rs. Included an explanatory note about using third-party hosts for signature verification. Removed an unused `.toak-ignore` file.
This commit is contained in:
@@ -1,3 +0,0 @@
|
|||||||
package.json
|
|
||||||
genaisrc/genaiscript.d.ts
|
|
||||||
.toak-ignore
|
|
@@ -17,7 +17,7 @@ async fn main() {
|
|||||||
// Initialize logging
|
// Initialize logging
|
||||||
init_logging();
|
init_logging();
|
||||||
|
|
||||||
// Load configuration
|
// init server configuration
|
||||||
let config = AppConfig::new();
|
let config = AppConfig::new();
|
||||||
|
|
||||||
// Create router with all routes
|
// Create router with all routes
|
||||||
|
@@ -14,6 +14,8 @@ pub struct SessionIdentity {
|
|||||||
pub user: Value
|
pub user: Value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for a production setup, use a 3rd party host to verify the signature
|
||||||
|
// I removed in this version because the identity server I built is not open source yet
|
||||||
pub async fn session_identify(session_token: &str) -> Result<SessionIdentity> {
|
pub async fn session_identify(session_token: &str) -> Result<SessionIdentity> {
|
||||||
let session_data_base64 = session_token.split('.').nth(0).ok_or_else(|| anyhow::anyhow!("Invalid session data format"))?;
|
let session_data_base64 = session_token.split('.').nth(0).ok_or_else(|| anyhow::anyhow!("Invalid session data format"))?;
|
||||||
// println!("session_data_base64: {}", session_data_base64);
|
// println!("session_data_base64: {}", session_data_base64);
|
||||||
|
Reference in New Issue
Block a user