Skip to content

Commit

Permalink
Rename variable, remove unused cdoe
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuwu committed Dec 25, 2023
1 parent d9de0a6 commit 85da48b
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
package com.example.manageproducts.data.repository.impl

import android.content.Context
import com.example.manageproducts.data.repository.AuthenticationRepository
import dagger.hilt.android.qualifiers.ApplicationContext
import io.github.jan.supabase.gotrue.Auth
import io.github.jan.supabase.gotrue.providers.Google
import io.github.jan.supabase.gotrue.providers.builtin.Email
import javax.inject.Inject

class AuthenticationRepositoryImpl @Inject constructor(
private val goTrue: Auth,
@ApplicationContext context: Context,
private val auth: Auth,
) : AuthenticationRepository {
override suspend fun signIn(email: String, password: String): Boolean {
return try {
goTrue.signInWith(Email) {
auth.signInWith(Email) {
this.email = email
this.password = password
}
Expand All @@ -26,7 +23,7 @@ class AuthenticationRepositoryImpl @Inject constructor(

override suspend fun signUp(email: String, password: String): Boolean {
return try {
goTrue.signUpWith(Email) {
auth.signUpWith(Email) {
this.email = email
this.password = password
}
Expand All @@ -38,7 +35,7 @@ class AuthenticationRepositoryImpl @Inject constructor(

override suspend fun signInWithGoogle(): Boolean {
return try {
goTrue.signInWith(Google)
auth.signInWith(Google)
true
} catch (e: Exception) {
false
Expand Down

0 comments on commit 85da48b

Please sign in to comment.