By saving the RefreshToken in an HTTP-only cookie it cannot be accessed or manipulated by JavaScript, but will be sent with each request with a greater risk of being intercepted.
When saving the RefreshToken in LocalStorage it can be accessed and manipulated via JavaScript, but it will only be sent to the server when the AccessToken needs to be renewed.
Each technique has its advantages and disadvantages.
Currently my rest API is https and stores the Access-Token in an http-only cookie on clients, in addition to returning the refreshToken in the http response body. In my http client I store the refreshToken in Local Storage and only send it in the request when I need to update the accessToken.
So which is the safest?