File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1210,8 +1210,20 @@ pub async fn refresh_tokens(
12101210) -> ApiResult < ( Device , AuthTokens ) > {
12111211 let refresh_claims = match decode_refresh ( refresh_token) {
12121212 Err ( err) => {
1213- debug ! ( "Failed to decode {} refresh_token: {refresh_token}" , ip. ip) ;
1214- err_silent ! ( format!( "Impossible to read refresh_token: {}" , err. message( ) ) )
1213+ error ! ( "Failed to decode {} refresh_token: {refresh_token}: {err:?}" , ip. ip) ;
1214+ //err_silent!(format!("Impossible to read refresh_token: {}", err.message()))
1215+
1216+ // If the token failed to decode, it was probably one of the old style tokens that was just a Base64 string.
1217+ // We can generate a claim for them for backwards compatibility. Note that the password refresh claims don't
1218+ // check expiration or issuer, so they're not included here.
1219+ RefreshJwtClaims {
1220+ nbf : 0 ,
1221+ exp : 0 ,
1222+ iss : String :: new ( ) ,
1223+ sub : AuthMethod :: Password ,
1224+ device_token : refresh_token. into ( ) ,
1225+ token : None ,
1226+ }
12151227 }
12161228 Ok ( claims) => claims,
12171229 } ;
You can’t perform that action at this time.
0 commit comments