Skip to content

Commit 67e990c

Browse files
committed
Fix parser
1 parent 2738939 commit 67e990c

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

android/app/src/main/java/com/httpsms/LoginActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class LoginActivity : AppCompatActivity() {
4444
apiKeyLayout.error = authResult
4545
return@run
4646
}
47+
Timber.d("login successfully redirecting to main view")
4748
Settings.setApiKeyAsync(this, apiKey.text.toString())
4849
redirectToMain()
4950
}

android/app/src/main/java/com/httpsms/MainActivity.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ class MainActivity : AppCompatActivity() {
5353
}
5454

5555
private fun refreshToken(context: Context) {
56+
if(!Settings.isLoggedIn(context)) {
57+
Timber.w("cannot refresh token because owner is not logged in")
58+
return
59+
}
60+
5661
if(!Settings.hasOwner(context)) {
5762
Timber.w("cannot refresh token because owner does not exist")
5863
return
@@ -104,12 +109,13 @@ class MainActivity : AppCompatActivity() {
104109
redirectToLogin()
105110
}
106111

107-
private fun redirectToLogin() {
112+
private fun redirectToLogin():Boolean {
108113
if (Settings.isLoggedIn(this)) {
109-
return
114+
return false
110115
}
111116
val switchActivityIntent = Intent(this, LoginActivity::class.java)
112117
startActivity(switchActivityIntent)
118+
return true
113119
}
114120

115121
private fun setActiveStatus(context: Context) {

api/pkg/handlers/phone_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (h *PhoneHandler) Upsert(c *fiber.Ctx) error {
109109
ctxLogger := h.tracer.CtxLogger(h.logger, span)
110110

111111
var request requests.PhoneUpsert
112-
if err := c.QueryParser(&request); err != nil {
112+
if err := c.BodyParser(&request); err != nil {
113113
msg := fmt.Sprintf("cannot marshall params [%s] into %T", c.OriginalURL(), request)
114114
ctxLogger.Warn(stacktrace.Propagate(err, msg))
115115
return h.responseBadRequest(c, err)

0 commit comments

Comments
 (0)