mirror of
https://github.com/usetrmnl/trmnl-android.git
synced 2026-04-29 13:35:26 -07:00
fix: trim access token on save to prevent illegal header chars
Trailing newlines (0x0a) in pasted tokens caused OkHttp to throw IllegalArgumentException when setting the access-token header. Trimming on save prevents whitespace from reaching the network layer.
This commit is contained in:
@@ -377,7 +377,7 @@ class TrmnlDeviceConfigDataStore
|
||||
*/
|
||||
suspend fun saveAccessToken(token: String) {
|
||||
context.deviceConfigStore.edit { preferences ->
|
||||
preferences[ACCESS_TOKEN_KEY] = token
|
||||
preferences[ACCESS_TOKEN_KEY] = token.trim()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user