-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(session): add create session cookie feature
- Loading branch information
1 parent
c0dc41a
commit 2996fd0
Showing
3 changed files
with
102 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use firestore_db_and_auth::*; | ||
use firestore_db_and_auth::sessions::user::Session; | ||
use std::fs; | ||
|
||
#[test] | ||
fn user_session_create_session_cookie() -> errors::Result<()> { | ||
let cred = credentials::Credentials::from_file("firebase-service-account.json").expect("Read credentials file"); | ||
let id_token: String = fs::read_to_string("refresh-token-for-tests.txt")?; | ||
|
||
println!("users::Session::create_session_cookie"); | ||
Session::create_session_cookie(&cred, id_token.to_string(), 3600)?; | ||
|
||
Ok(()) | ||
} |