evcc-io / app

native evcc app frame for iOS (and Android)
https://evcc.io/
MIT License
7 stars 4 forks source link

Added Basic Auth Support #15

Closed reifl closed 1 month ago

reifl commented 1 month ago

fixes https://github.com/evcc-io/app/issues/5

Added support for Basic Auth. When the Server is found via mDns it submits the Address to the ServerManualScreen where the User can input the Credentials.

reifl commented 1 month ago

i've accidentally commited an update of expo-dev-client and react-native-v8 with my initial pull request. Needed to update them to build for android, the "npm run android" always exited with an error but thats another problem and shouldn't be in this pull request so i commited a new version of the package.json where i've reverted to the original package version.

naltatis commented 1 month ago

@reifl tried to test it but got errors:

Bildschirmfoto 2024-08-18 um 19 19 38

I also just updated the npm deps. Maybe this solves your issues above.

We should also support the auto-discovery use-case. Maybe it's a good idea to check auto-detect if auth is required during the validateAndSaveURL and then prompt the user for credentials if we dont have them.

reifl commented 1 month ago

I've merged your update to my fork and tried it. It works on my Android Device, unluckly i don't have a mac on hand to test the iOS build. I will try to organize one next week so i can check whats happening.

To your auto-discovery use-case. you mean the "Suche starten" on the Main Screen? If so this use-case should be covered. When the user selects a server which needs basic auth (401 Status code) it switches to the "Adresse manuell eingeben" mask with prefilled Server Information.

naltatis commented 1 month ago

If so this use-case should be covered. When the user selects a server which needs basic auth (401 Status code) it switches to the "Adresse manuell eingeben" mask with prefilled Server Information.

Ah ok, perfect

naltatis commented 1 month ago

I've merged your update to my fork and tried it.

Tried it after the upgrade but still not able to run in iOS simulator or on-device. I'll try to run it on my android test device during the week.

Another thing: looks like your code is not prettier-formatted. Please npm run format or enable format-on-save in your editor.

reifl commented 1 month ago

iOS version should now work and ran "npm run format"

naltatis commented 1 month ago

@reifl I accidentally merged your PR to main. Not quite sure how this happened gh pr magic. But I'll then make the above changes directly in main. Thanks for your work 💚