There is a lot of topics about localstorage and how to secure it but i didnt found 100% offline solution(I dont know if its even possible).
My app is using ionic framework + ng-token-auth + devise-token-auth.
I have authentication stuff in it.
All I really want to store in localstorage are photos but those photos belongs to particular user...
I want to make my app working offline also, so my idea is to create localPassword value(random) in registration procedure and then return this value to the client-side and save it locally.
I will use that value to encode photos using AES encryption(propably forge) and store this value locally. This value will be updating on every sign_in() procedure and it will be destroyed at sign_out().
In case when internet connection will be lost and authentication will be unable than I open my app and show decoded photos using this localPassword, that are belonging to the last logged user.
sorry for bad english, thanks for any advice !