Skip to content

Commit

Permalink
- signout action added
Browse files Browse the repository at this point in the history
  • Loading branch information
Semih Özköroğlu committed Aug 26, 2022
1 parent e4fbe77 commit f0ce572
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions rbs/src/main/java/com/rettermobile/rbs/RBS.kt
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,18 @@ class RBS(

fun signOut() {
RBSLogger.log("signOut called")
// val request = TokenManager.userId?.let {
// mapOf(Pair("allTokens", true), Pair("userId", it))
// } ?: kotlin.run { mapOf(Pair("allTokens", true)) }

clearSession()

// sendAction(RBSActions.LOGOUT.action, request, success = {
// clearSession()
// }, error = {
// clearSession()
// })
val request = TokenManager.userId?.let {
mapOf(Pair("allTokens", true), Pair("userId", it))
} ?: kotlin.run { mapOf(Pair("allTokens", true)) }


sendAction(RBSActions.LOGOUT.action, request, success = {
RBSLogger.log("signOut RBSActions.LOGOUT OK $it")
clearSession()
}, error = {
RBSLogger.log("signOut RBSActions.LOGOUT ERROR ${it?.message ?: it?.stackTraceToString()}")
clearSession()
})
}

private fun clearSession() {
Expand Down

0 comments on commit f0ce572

Please sign in to comment.