diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-03 13:22:06 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-03 13:22:06 -0700 |
commit | 35185958b077880465696d686bd797895cd3ebd4 (patch) | |
tree | 431967b2b00d00c71b06fa7a7814e05524961ead /app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt | |
parent | 5796566137995c8d244720f87ba85bce0e0d2f00 (diff) | |
download | frost-35185958b077880465696d686bd797895cd3ebd4.tar.gz frost-35185958b077880465696d686bd797895cd3ebd4.tar.bz2 frost-35185958b077880465696d686bd797895cd3ebd4.zip |
setup login activity
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt index 6e0cf201..aa40f1f1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt @@ -39,6 +39,7 @@ class LoginWebView @JvmOverloads constructor( lateinit var progressObservable: Subject<Int> init { + FbCookie.reset() cookieObservable.filter { (_, cookie) -> cookie?.contains(userMatcher) ?: false } .subscribe { (url, cookie) -> @@ -46,9 +47,10 @@ class LoginWebView @JvmOverloads constructor( val id = userMatcher.find(cookie!!)?.groups?.get(1)?.value if (id != null) { try { - FbCookie.save(id.toLong(), -1) + FbCookie.save(id.toLong()) //TODO proceed to next view cookieObservable.onComplete() + loginObservable.onSuccess(CookieModel(id.toLong(), "", cookie)) } catch (e: NumberFormatException) { //todo send report that id has changed } |