-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from CrisisCleanup/forgot-password
Refactor auth flows and add forgot password
- Loading branch information
Showing
31 changed files
with
1,207 additions
and
129 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
45 changes: 45 additions & 0 deletions
45
app/src/main/java/com/crisiscleanup/navigation/CrisisCleanupAuthNavHost.kt
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,45 @@ | ||
package com.crisiscleanup.navigation | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
import androidx.navigation.NavHostController | ||
import androidx.navigation.compose.NavHost | ||
import com.crisiscleanup.core.appnav.RouteConstant | ||
import com.crisiscleanup.feature.authentication.navigation.authGraph | ||
import com.crisiscleanup.feature.authentication.navigation.emailLoginLinkScreen | ||
import com.crisiscleanup.feature.authentication.navigation.forgotPasswordScreen | ||
import com.crisiscleanup.feature.authentication.navigation.navigateToEmailLoginLink | ||
import com.crisiscleanup.feature.authentication.navigation.navigateToForgotPassword | ||
|
||
@Composable | ||
fun CrisisCleanupAuthNavHost( | ||
navController: NavHostController, | ||
enableBackHandler: Boolean, | ||
closeAuthentication: () -> Unit, | ||
onBack: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
startDestination: String = RouteConstant.authGraphRoutePattern, | ||
) { | ||
val navToForgotPassword = | ||
remember(navController) { { navController.navigateToForgotPassword() } } | ||
val navToEmailMagicLink = | ||
remember(navController) { { navController.navigateToEmailLoginLink() } } | ||
|
||
NavHost( | ||
navController = navController, | ||
startDestination = startDestination, | ||
modifier = modifier, | ||
) { | ||
authGraph( | ||
nestedGraphs = { | ||
forgotPasswordScreen(onBack) | ||
emailLoginLinkScreen(onBack) | ||
}, | ||
enableBackHandler = enableBackHandler, | ||
closeAuthentication = closeAuthentication, | ||
openForgotPassword = navToForgotPassword, | ||
openEmailMagicLink = navToEmailMagicLink, | ||
) | ||
} | ||
} |
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
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
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
Oops, something went wrong.