Skip to content

Commit

Permalink
method name shortened + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Proziam committed Oct 22, 2024
1 parent 978ac1e commit d7617cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ impl AuthClient {
/// # Example
/// ```
/// let session = auth_client
/// .sign_in_with_phone_and_password(demo_phone, demo_password)
/// .login_with_phone(demo_phone, demo_password)
/// .await
/// .unwrap();
///
/// assert!(session.user.phone == demo_phone)
/// ```
pub async fn sign_in_with_phone_and_password<S: Into<String>>(
pub async fn login_with_phone<S: Into<String>>(
&self,
phone: S,
password: S,
Expand Down Expand Up @@ -399,7 +399,7 @@ impl AuthClient {
/// .await
/// .unwrap();
/// ```
pub async fn sign_in_with_oauth(
pub async fn login_with_oauth(
&self,
provider: Provider,
options: Option<SignInWithOAuthOptions>,
Expand Down
28 changes: 14 additions & 14 deletions tests/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn test_mobile_flow() {
assert!(session.is_ok());

let new_session = auth_client
.sign_in_with_phone_and_password(&demo_phone, &demo_password)
.login_with_phone(&demo_phone, &demo_password)
.await;

if new_session.is_err() {
Expand Down Expand Up @@ -165,7 +165,7 @@ async fn sign_in_with_oauth_test() {
};

let response = auth_client
.sign_in_with_oauth(supabase_auth::models::Provider::Github, Some(options))
.login_with_oauth(supabase_auth::models::Provider::Github, Some(options))
.await;

if response.is_err() {
Expand All @@ -179,20 +179,20 @@ async fn sign_in_with_oauth_test() {
async fn sign_in_with_oauth_no_options_test() {
let auth_client = create_test_client();

// Must login to get a user bearer token
let demo_email = env::var("DEMO_EMAIL").unwrap();
let demo_password = env::var("DEMO_PASSWORD").unwrap();

let session = auth_client
.login_with_email(demo_email, demo_password)
.await;

if session.is_err() {
eprintln!("{:?}", session.as_ref().unwrap_err())
}
// // Must login to get a user bearer token
// let demo_email = env::var("DEMO_EMAIL").unwrap();
// let demo_password = env::var("DEMO_PASSWORD").unwrap();
//
// let session = auth_client
// .login_with_email(demo_email, demo_password)
// .await;
//
// if session.is_err() {
// eprintln!("{:?}", session.as_ref().unwrap_err())
// }

let response = auth_client
.sign_in_with_oauth(supabase_auth::models::Provider::Github, None)
.login_with_oauth(supabase_auth::models::Provider::Github, None)
.await;

println!(
Expand Down

0 comments on commit d7617cb

Please sign in to comment.