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:
Hossain Khan
2026-04-03 09:21:01 -04:00
parent fd3d001d7a
commit 4d7685faaf
@@ -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()
}
}