Kaynağa Gözat

Saving password on sharedprefs of a user from login and signup fragment, created a password model, storing daat in model and passed to newItemFormFragment for add item API

Khubaib 1 hafta önce
ebeveyn
işleme
9db4e435ce

+ 2 - 6
app/src/main/java/com/fastest/pass/app/Utils.kt

@@ -33,22 +33,18 @@ class Utils {
             data: String,
             secretKeyString: String,
             ivString: String,
-            saltString: String
-        ) : Pair<String, String> {
+        ) : String {
             val ivKey: IvParameterSpec = IvParameterSpec(ivString.toByteArray(Charsets.UTF_8))
             val secKey: SecretKey = SecretKeySpec(secretKeyString.toByteArray(Charsets.UTF_8), "AES")
-            val encryptionWithSalt = saltString.toByteArray(Charsets.UTF_8) + data.toByteArray(Charsets.UTF_8)
 
             val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding")
             cipher.init(Cipher.ENCRYPT_MODE, secKey, ivKey)
-
             val encryptedData = cipher.doFinal(data.toByteArray())
 
-//    val encryptedData = cipher.doFinal(data.toByteArray())
             val ivBase64 = Base64.encodeToString(ivString.toByteArray(Charsets.UTF_8), Base64.DEFAULT)
             val encryptedDataBase64 = Base64.encodeToString(encryptedData, Base64.DEFAULT)
 
-            return Pair(ivBase64, encryptedDataBase64)
+            return encryptedDataBase64
         }
 
         fun decryptData(ivBase64: String, encryptedBase64: String, secretKeyString: String) : String {

+ 10 - 0
app/src/main/java/com/fastest/pass/helpers/BasePreferenceHelper.kt

@@ -12,6 +12,7 @@ class BasePreferenceHelper(private val context: Context) : PreferencesHelper() {
         removePreference(context, KEY_FILENAME, KEY_BEARER_TOKEN)
         removePreference(context, KEY_FILENAME, KEY_USERINFO)
         removePreference(context, KEY_FILENAME, KEY_SALT_KEY)
+        removePreference(context, KEY_FILENAME, KEY_PASSWORD)
     }
 
     fun setLoggedInState(state: Boolean) {
@@ -51,11 +52,20 @@ class BasePreferenceHelper(private val context: Context) : PreferencesHelper() {
         return getStringPreference(context, KEY_FILENAME, KEY_SALT_KEY)
     }
 
+    fun savePassword(password: String) {
+        putStringPreference(context, KEY_FILENAME, KEY_PASSWORD, password)
+    }
+
+    fun getPassword(): String? {
+        return getStringPreference(context, KEY_FILENAME, KEY_PASSWORD)
+    }
+
     companion object {
         private const val KEY_FILENAME = "file_fastestpass"
         private const val KEY_IS_LOGGED_IN = "key_isloggedin"
         private const val KEY_BEARER_TOKEN = "key_bearer_token"
         private const val KEY_USERINFO = "key_userinfo"
         private const val KEY_SALT_KEY = "key_salt_key"
+        private const val KEY_PASSWORD = "key_password"
     }
 }

+ 7 - 0
app/src/main/java/com/fastest/pass/home/domain/model/PasswordFormData.kt

@@ -0,0 +1,7 @@
+package com.fastest.pass.home.domain.model
+
+data class PasswordFormData(
+    val key: String,
+    val value: String,
+    val vaultItemName: String = "passwords"
+)

+ 10 - 10
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddNewItemsScreen.kt

@@ -46,16 +46,16 @@ import com.fastest.pass.R
 import com.fastest.pass.home.domain.model.AddNewItem
 import com.fastest.pass.login.presentation.ui.components.ClickType
 
-enum class ClickTypeAddNewItem {
-    GOTO_HOME,
-    Password,
-    Bank,
-    Payment,
-    Wifi,
-    Note,
-    Contact,
-    Driver,
-    Passport
+enum class ClickTypeAddNewItem(val value: String, val vaultKey: String) {
+    GOTO_HOME("GOTO_HOME", ""),
+    Password("Password", "passwords"),
+    Bank("Bank", "bank-accounts"),
+    Payment("Payment", "payment-cards"),
+    Wifi("Wifi", "wifi-password"),
+    Note("Note", "notes"),
+    Contact("Contact", "address"),
+    Driver("Driver", "drivers-license"),
+    Passport("Passport", "passports")
 }
 
 @Composable

+ 89 - 14
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddPasswordFormScreen.kt

@@ -1,5 +1,6 @@
 package com.fastest.pass.home.presentation.ui.components
 
+import android.util.Log
 import androidx.compose.foundation.Image
 import androidx.compose.foundation.background
 import androidx.compose.foundation.border
@@ -61,11 +62,23 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import com.fastest.pass.R
+import com.fastest.pass.app.Utils
+import com.fastest.pass.helpers.BasePreferenceHelper
+import com.fastest.pass.home.domain.model.PasswordFormData
+import javax.inject.Inject
 
 @Composable
-fun AddPasswordFormScreen() {
+fun AddPasswordFormScreen(
+    onPasswordsFormList: (ArrayList<PasswordFormData>) -> Unit,
+    basePreferenceHelper: BasePreferenceHelper
+) {
     val keyboardController = LocalSoftwareKeyboardController.current
     val focusManager = LocalFocusManager.current
+    var passwords_title by remember { mutableStateOf("") }
+    var passwords_url by remember { mutableStateOf("") }
+    var passwords_username by remember { mutableStateOf("") }
+    var passwords_password by remember { mutableStateOf("") }
+    var passwords_notes by remember { mutableStateOf("") }
 
     Box(
         modifier = Modifier
@@ -75,7 +88,34 @@ fun AddPasswordFormScreen() {
             .background(Color.Transparent)
             .imePadding()
     ) {
-        SaveButtonAPWFS(buttonText = R.string.save)
+        SaveButtonAPWFS(
+            buttonText = R.string.save,
+            onSaveButtonCLick = {
+                val passwordsFormList = ArrayList<PasswordFormData>()
+                val saltKey = basePreferenceHelper.getCustomSaltKey()
+                val userPassword = basePreferenceHelper.getPassword()
+
+                Log.d("saltKey", "saltKey = $saltKey, password = $userPassword")
+//                val passwords_title_enc = Utils.encryptData(
+//                    passwords_title, userPassword ?: "", saltKey ?: "")
+//                passwords_url = Utils.encryptData(
+//                    passwords_url, userPassword ?: "", saltKey ?: "")
+//                passwords_username = Utils.encryptData(
+//                    passwords_username, userPassword ?: "", saltKey ?: "")
+//                passwords_password = Utils.encryptData(
+//                    passwords_password, userPassword ?: "", saltKey ?: "")
+//                passwords_notes = Utils.encryptData(
+//                    passwords_notes, userPassword ?: "", saltKey ?: "")
+
+                passwordsFormList.add(PasswordFormData("passwords_title", passwords_title))
+                passwordsFormList.add(PasswordFormData("passwords_url", passwords_url))
+                passwordsFormList.add(PasswordFormData("passwords_username", passwords_username))
+                passwordsFormList.add(PasswordFormData("passwords_password", passwords_password))
+                passwordsFormList.add(PasswordFormData("passwords_notes", passwords_notes))
+
+                onPasswordsFormList.invoke(passwordsFormList)
+            }
+        )
 
         Column(
             modifier = Modifier
@@ -86,15 +126,35 @@ fun AddPasswordFormScreen() {
                 .verticalScroll(rememberScrollState())
         ) {
             Spacer(modifier = Modifier.height(20.dp))
-            TitleTextFieldAPS(keyboardController = keyboardController, focusManager = focusManager)
+            TitleTextFieldAPS(
+                keyboardController = keyboardController,
+                focusManager = focusManager,
+                onTitleText = { passwords_title = it }
+            )
             Spacer(modifier = Modifier.height(20.dp))
-            UrlTextFieldAPS(keyboardController = keyboardController, focusManager = focusManager)
+            UrlTextFieldAPS(
+                keyboardController = keyboardController,
+                focusManager = focusManager,
+                onUrlText = { passwords_url = it }
+            )
             Spacer(modifier = Modifier.height(20.dp))
-            UsernameTextFieldAPS(keyboardController = keyboardController, focusManager = focusManager)
+            UsernameTextFieldAPS(
+                keyboardController = keyboardController,
+                focusManager = focusManager,
+                onUsernameText = { passwords_username = it }
+            )
             Spacer(modifier = Modifier.height(20.dp))
-            PasswordTextFieldAPS(keyboardController = keyboardController, focusManager = focusManager)
+            PasswordTextFieldAPS(
+                keyboardController = keyboardController,
+                focusManager = focusManager,
+                onPasswordText = { passwords_password = it }
+            )
             Spacer(modifier = Modifier.height(20.dp))
-            NotesTextFieldAPS(keyboardController = keyboardController, focusManager = focusManager)
+            NotesTextFieldAPS(
+                keyboardController = keyboardController,
+                focusManager = focusManager,
+                onNotesText = { passwords_notes = it }
+            )
             Spacer(modifier = Modifier.height(25.dp))
             OptionsText()
             Spacer(modifier = Modifier.height(25.dp))
@@ -109,7 +169,8 @@ fun AddPasswordFormScreen() {
 @Composable
 fun ColumnScope.TitleTextFieldAPS(
     keyboardController: SoftwareKeyboardController?,
-    focusManager: FocusManager
+    focusManager: FocusManager,
+    onTitleText: (String) -> Unit
 ) {
     var titleText by remember { mutableStateOf("") }
 
@@ -117,6 +178,7 @@ fun ColumnScope.TitleTextFieldAPS(
         value = titleText,
         onValueChange = {
             titleText = it
+            onTitleText.invoke(titleText)
         },
         textStyle = MaterialTheme.typography.displayMedium,
         modifier = Modifier
@@ -178,7 +240,8 @@ fun ColumnScope.TitleTextFieldAPS(
 @Composable
 fun ColumnScope.UrlTextFieldAPS(
     keyboardController: SoftwareKeyboardController?,
-    focusManager: FocusManager
+    focusManager: FocusManager,
+    onUrlText: (String) -> Unit
 ) {
     var urlText by remember { mutableStateOf("") }
 
@@ -186,6 +249,7 @@ fun ColumnScope.UrlTextFieldAPS(
         value = urlText,
         onValueChange = {
             urlText = it
+            onUrlText.invoke(urlText)
         },
         textStyle = MaterialTheme.typography.displayMedium,
         modifier = Modifier
@@ -262,7 +326,8 @@ fun ColumnScope.UrlTextFieldAPS(
 @Composable
 fun ColumnScope.UsernameTextFieldAPS(
     keyboardController: SoftwareKeyboardController?,
-    focusManager: FocusManager
+    focusManager: FocusManager,
+    onUsernameText: (String) -> Unit
 ) {
     var usernameText by remember { mutableStateOf("") }
 
@@ -270,6 +335,7 @@ fun ColumnScope.UsernameTextFieldAPS(
         value = usernameText,
         onValueChange = {
             usernameText = it
+            onUsernameText.invoke(usernameText)
         },
         textStyle = MaterialTheme.typography.displayMedium,
         modifier = Modifier
@@ -331,7 +397,8 @@ fun ColumnScope.UsernameTextFieldAPS(
 @Composable
 fun ColumnScope.PasswordTextFieldAPS(
     keyboardController: SoftwareKeyboardController?,
-    focusManager: FocusManager
+    focusManager: FocusManager,
+    onPasswordText: (String) -> Unit
 ) {
     var passwordText by remember { mutableStateOf("") }
     var passwordVisible by remember { mutableStateOf(false) }
@@ -340,6 +407,7 @@ fun ColumnScope.PasswordTextFieldAPS(
         value = passwordText,
         onValueChange = {
             passwordText = it
+            onPasswordText.invoke(passwordText)
         },
         textStyle = MaterialTheme.typography.displayMedium,
         modifier = Modifier
@@ -425,7 +493,8 @@ fun ColumnScope.PasswordTextFieldAPS(
 @Composable
 fun ColumnScope.NotesTextFieldAPS(
     keyboardController: SoftwareKeyboardController?,
-    focusManager: FocusManager
+    focusManager: FocusManager,
+    onNotesText: (String) -> Unit
 ) {
     var notesText by remember { mutableStateOf("") }
 
@@ -433,6 +502,7 @@ fun ColumnScope.NotesTextFieldAPS(
         value = notesText,
         onValueChange = {
             notesText = it
+            onNotesText.invoke(notesText)
         },
         textStyle = MaterialTheme.typography.displayMedium,
         modifier = Modifier
@@ -580,7 +650,10 @@ fun ColumnScope.SaveButtonAPFS(buttonText: Int) {
 }
 
 @Composable
-fun BoxScope.SaveButtonAPWFS(buttonText: Int) {
+fun BoxScope.SaveButtonAPWFS(
+    buttonText: Int,
+    onSaveButtonCLick: () -> Unit
+    ) {
     Button(
         modifier = Modifier
             .background(colorResource(id = R.color.transparent))
@@ -588,7 +661,9 @@ fun BoxScope.SaveButtonAPWFS(buttonText: Int) {
             .height(60.dp)
             .align(Alignment.BottomCenter)
             .clickable() { },
-        onClick = {},
+        onClick = {
+            onSaveButtonCLick.invoke()
+        },
         shape = RoundedCornerShape(15.dp),
 //            border = BorderStroke(25.dp, colorResource(id = R.color.black)),
         colors = ButtonDefaults.buttonColors(

+ 11 - 2
app/src/main/java/com/fastest/pass/home/presentation/ui/components/NewItemFormScreen.kt

@@ -33,7 +33,9 @@ import androidx.compose.ui.res.stringResource
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import com.fastest.pass.R
+import com.fastest.pass.helpers.BasePreferenceHelper
 import com.fastest.pass.home.domain.model.CountryInfo
+import com.fastest.pass.home.domain.model.PasswordFormData
 
 enum class ClickTypeNewItemForm {
     GO_BACK_ADD_NEW_ITEM
@@ -46,7 +48,9 @@ fun NewItemFormScreen(
     clickType: (ClickTypeNewItemForm) -> Unit,
     onSearchTextChanged: (String) -> Unit,
     onCountryList: (List<CountryInfo>, String) -> Unit,
-    countryListDisplayed: List<CountryInfo>
+    countryListDisplayed: List<CountryInfo>,
+    onPasswordsFormList: (ArrayList<PasswordFormData>) -> Unit,
+    basePreferenceHelper: BasePreferenceHelper
 ) {
     val keyboardController = LocalSoftwareKeyboardController.current
     val focusManager = LocalFocusManager.current
@@ -81,7 +85,12 @@ fun NewItemFormScreen(
 
         when (screenNameType) {
             ClickTypeAddNewItem.Password -> {
-                AddPasswordFormScreen()
+                AddPasswordFormScreen(
+                    onPasswordsFormList = {
+                        onPasswordsFormList.invoke(it)
+                    },
+                    basePreferenceHelper = basePreferenceHelper
+                )
             }
             ClickTypeAddNewItem.Bank -> {
                 AddBankAccountFormScreen()

+ 9 - 0
app/src/main/java/com/fastest/pass/home/presentation/ui/fragment/HomeFragment.kt

@@ -16,6 +16,7 @@ import androidx.compose.ui.res.colorResource
 import androidx.fragment.app.viewModels
 import com.fastest.pass.app.BaseFragment
 import com.fastest.pass.R
+import com.fastest.pass.app.Utils
 import com.fastest.pass.helpers.BasePreferenceHelper
 import com.fastest.pass.home.presentation.ui.components.ClickType
 import com.fastest.pass.home.presentation.ui.components.HomeScreen
@@ -57,6 +58,14 @@ class HomeFragment : BaseFragment() {
                                 .background(colorResource(id = R.color.home_background_color))
                                 .padding(paddingValues.calculateBottomPadding())
                         ) {
+
+//                            val saltKey = basePreferenceHelper.getCustomSaltKey()
+//                            val userPassword = basePreferenceHelper.getPassword()
+//
+//                            val passwords_title_enc = Utils.encryptData(
+//                                "khubaibparacha", "userPassword" ?: "", saltKey ?: "")
+//                            Log.d("saltKey", "saltKey = $saltKey, password = $userPassword, passwords_title_enc = $passwords_title_enc")
+
                             HomeScreen { clickType ->
                                 when (clickType) {
                                     ClickType.GOTO_ADD_NEW_ITEMS -> {

+ 14 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/fragment/NewItemFormFragment.kt

@@ -10,7 +10,9 @@ import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.padding
 import androidx.compose.material.Scaffold
+import androidx.compose.material3.SnackbarHostState
 import androidx.compose.runtime.collectAsState
+import androidx.compose.runtime.remember
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.platform.ComposeView
 import androidx.compose.ui.res.colorResource
@@ -18,6 +20,7 @@ import androidx.fragment.app.activityViewModels
 import androidx.fragment.app.viewModels
 import com.fastest.pass.app.BaseFragment
 import com.fastest.pass.R
+import com.fastest.pass.helpers.BasePreferenceHelper
 import com.fastest.pass.home.presentation.ui.components.ClickTypeAddNewItem
 import com.fastest.pass.home.presentation.ui.components.ClickTypeNewItemForm
 import com.fastest.pass.home.presentation.ui.components.NewItemFormScreen
@@ -37,6 +40,8 @@ class NewItemFormFragment : BaseFragment() {
 
     @Inject
     lateinit var navigation: NewItemFormNavigation
+    @Inject
+    lateinit var basePreferenceHelper: BasePreferenceHelper
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -62,6 +67,7 @@ class NewItemFormFragment : BaseFragment() {
                         ) {
                             val screenName = viewmodelAddNewItems.itemScreenName.collectAsState()
                             var headerName: String = ""
+                            val snackBarStateRed = remember { SnackbarHostState() }
                             Log.d("test_screen_name", "NIFF::screenName = ${screenName.value}")
 
                             val countryList = viewmodel.countriesList.collectAsState()
@@ -109,7 +115,14 @@ class NewItemFormFragment : BaseFragment() {
                                 onCountryList = { list, text ->
                                     viewmodel.getCountries(text =  text, countryList = list)
                                 },
-                                countryListDisplayed = countryList.value
+                                countryListDisplayed = countryList.value,
+                                onPasswordsFormList = { passwordFormData ->
+                                    Log.d("passwordFormData", passwordFormData.size.toString())
+                                    passwordFormData.forEachIndexed { i, data ->
+                                        Log.d("passwordFormData", "${data.key}, ${data.value}, ${data.vaultItemName}")
+                                    }
+                                },
+                                basePreferenceHelper = basePreferenceHelper
                             )
                         }
                     }

+ 8 - 3
app/src/main/java/com/fastest/pass/login/presentation/ui/LoginFragment.kt

@@ -42,6 +42,8 @@ import javax.inject.Inject
 class LoginFragment : BaseFragment() {
 
     val viewmodel: LoginViewModel by viewModels()
+    var emailLogin = ""
+    var passwordLogin = ""
 
     @Inject
     lateinit var navigation: LoginNavigation
@@ -82,6 +84,7 @@ class LoginFragment : BaseFragment() {
                                     basePreferenceHelper.saveUserInfo(it.userinfo)
                                     val saltKey = Utils.customSaltKey(it.userinfo)
                                     basePreferenceHelper.saveCustomSaltKey(saltKey)
+                                    basePreferenceHelper.savePassword(passwordLogin)
                                     viewmodel.navigateTo(LoginRoute.OpenDashBoardScreen)
                                 }
                             }
@@ -118,9 +121,11 @@ class LoginFragment : BaseFragment() {
                                     }
                                 }
                             },
-                                onLoginClickCredentials = { email , password ->
-                                Log.d("test_api_login", "onLoginClickCredentials => LoginFragment : $email , $password")
-                                viewmodel.login(email, password)
+                                onLoginClickCredentials = { email , password, hashPassword ->
+                                emailLogin = email
+                                passwordLogin = password
+                                Log.d("test_api_login", "onLoginClickCredentials => LoginFragment : $emailLogin , $passwordLogin, $hashPassword")
+                                viewmodel.login(email, hashPassword)
                             },
                                 onShowSnackBar = { text ->
                                     coroutineScope.launch {

+ 5 - 5
app/src/main/java/com/fastest/pass/login/presentation/ui/components/LoginScreen.kt

@@ -83,7 +83,7 @@ enum class ClickType {
 @Composable
 fun LoginScreen(
     clickType: (ClickType) -> Unit,
-    onLoginClickCredentials: (String, String) -> Unit,
+    onLoginClickCredentials: (String, String, String) -> Unit,
     onShowSnackBar: (Int) -> Unit
 ) {
     val keyboardController = LocalSoftwareKeyboardController.current
@@ -140,8 +140,8 @@ fun LoginScreen(
                 },
                     email = emailLogin,
                     password = passwordLogin,
-                    onLoginClickCredentials = { email, password ->
-                    onLoginClickCredentials.invoke(email, password)
+                    onLoginClickCredentials = { email, password , hashPassword->
+                    onLoginClickCredentials.invoke(email, password, hashPassword)
                 },
                     keyboardController,
                     focusManager,
@@ -409,7 +409,7 @@ fun ColumnScope.LoginButton(
     clickType: (ClickType) -> Unit,
     email: String,
     password: String,
-    onLoginClickCredentials: (String, String) -> Unit,
+    onLoginClickCredentials: (String, String, String) -> Unit,
     keyboardController: SoftwareKeyboardController?,
     focusManager: FocusManager,
     onShowSnackBar: (Int) -> Unit
@@ -428,7 +428,7 @@ fun ColumnScope.LoginButton(
                 focusManager.clearFocus()
                 keyboardController?.hide()
                 val hashPassword = Utils.hashing_sha256(password)
-                onLoginClickCredentials.invoke(email, hashPassword)
+                onLoginClickCredentials.invoke(email, password, hashPassword)
             } else if (email.isEmpty()) {
                 onShowSnackBar.invoke(R.string.email_field_req)
             } else if (password.isEmpty()) {

+ 6 - 3
app/src/main/java/com/fastest/pass/signup/presentation/ui/SignUpFragment.kt

@@ -29,6 +29,7 @@ class SignUpFragment : BaseFragment() {
     val viewmodelLogin: LoginViewModel by viewModels()
     var emailSU = ""
     var passwordSU = ""
+    var hashPasswordSU = ""
 
     @Inject
     lateinit var navigation: SignUpNavigation
@@ -55,7 +56,7 @@ class SignUpFragment : BaseFragment() {
                     Log.d("test_signup_api", "loginResponse = ${loginResponse.response?.message}")
 
                     if (signupResponse.response?.status == true) {
-                        viewmodelLogin.login(emailSU, passwordSU)
+                        viewmodelLogin.login(emailSU, hashPasswordSU)
                     }
 
                     loginResponse.response?.let { it ->
@@ -66,6 +67,7 @@ class SignUpFragment : BaseFragment() {
                                 it1 -> basePreferenceHelper.saveUserInfo(it1)
                                 val saltKey = Utils.customSaltKey(it1)
                                 basePreferenceHelper.saveCustomSaltKey(saltKey)
+                                basePreferenceHelper.savePassword(passwordSU)
                             }
                             viewmodel.navigateTo(SignUpRoute.OpenDashBoardScreen)
                         }
@@ -86,11 +88,12 @@ class SignUpFragment : BaseFragment() {
                                 }
                             }
                         },
-                        onSignupClickCredentials = { email, password ->
+                        onSignupClickCredentials = { email, password, hashPassword ->
                             emailSU = email
                             passwordSU = password
+                            hashPasswordSU = hashPassword
                             Log.d("test_signup_api", "onSignupClickCredentials => $emailSU, $passwordSU")
-                            viewmodel.signup(email, password)
+                            viewmodel.signup(email, hashPassword)
                         }
                     )
 

+ 5 - 5
app/src/main/java/com/fastest/pass/signup/presentation/ui/components/SignUpScreen.kt

@@ -73,7 +73,7 @@ enum class ClickType {
 @Composable
 fun SignUpScreen(
     clickType: (ClickType) -> Unit,
-    onSignupClickCredentials: (String, String) -> Unit
+    onSignupClickCredentials: (String, String, String) -> Unit
 ) {
     val keyboardController = LocalSoftwareKeyboardController.current
     val focusManager = LocalFocusManager.current
@@ -124,8 +124,8 @@ fun SignUpScreen(
                     },
                     email = emailSignup,
                     password = passwordSignup,
-                    onSignupClickCredentials = { email, password ->
-                        onSignupClickCredentials.invoke(email, password)
+                    onSignupClickCredentials = { email, password, hashPassword ->
+                        onSignupClickCredentials.invoke(email, password, hashPassword)
                     },
                     snackBarStateRed = snackBarStateRed,
                     keyboardController,
@@ -391,7 +391,7 @@ fun ColumnScope.SignUpButton(
     clickType: (ClickType) -> Unit,
     email: String,
     password: String,
-    onSignupClickCredentials: (String, String) -> Unit,
+    onSignupClickCredentials: (String, String, String) -> Unit,
     snackBarStateRed: SnackbarHostState,
     keyboardController: SoftwareKeyboardController?,
     focusManager: FocusManager
@@ -414,7 +414,7 @@ fun ColumnScope.SignUpButton(
                 focusManager.clearFocus()
                 keyboardController?.hide()
                 val hashPassword = Utils.hashing_sha256(password)
-                onSignupClickCredentials.invoke(email, hashPassword)
+                onSignupClickCredentials.invoke(email, password, hashPassword)
             } else if (email.isEmpty()) {
                 coroutineScope.launch {
                     snackBarStateRed.showSnackbar(context.getString(R.string.email_field_req))