I'm getting a bit lost in the structure of things (and firmly believe that if its that complicated, it shouldn't be that way, but that's another discussion).
Basically, we have an Angular web app and a Nativescript app in an NX workspace. The main code is all in 'libs' where we have a structure like:
libs/
/web
/nativescript
/shared
Now the 'shared' part contains the authentication logic, because that's really generic. It contains the authentication service, an http interceptor etc. However, we're using localStorage (on the web) and appSettings (for the apps) to store information in there in one service that's utilized in multiple other places.
In order to make this work, the only way currently is to duplicate all of the auth code into both web and nativescript and change this one file that is using different code depending on platform.
I'm sure there must be a better way of doing this, but I can't for the life of me find it.
e.g. how to provide/import a file depending on platform? When this file is used throughout multiple other services? When we can't do a simple if mobile else web
any more?
At this point I might be over-complicating things, so please let me know your thoughts!