voorkant / voorkant-core

https://voorkant.org/
MIT License
2 stars 3 forks source link

Retrieve long token in register.sh #18

Closed cyclops1982 closed 9 months ago

cyclops1982 commented 9 months ago

This gives us a long lived token out of register.sh, which is easier to work with and allows us to developer for longer than one hour. Yes, we're slow like that :smile:

We currently still use a trick to redirect cerr to somewhere else, to only capture the token. This likely will break as we forget about this, and realistically tihs is only needed because main() does the connect() and start(). It would be better if the uithread function creates and starts the backend. The UI might dictate where the configuration of the URL is stored, and thus should provide that to the backend. (for cli, we might do environment vars, for lvgl we might have some config file or UI setting?)

Habbie commented 9 months ago

main() does the connect() and start().

actually only connect() right now.

It would be better if the uithread function creates and starts the backend. The UI might dictate where the configuration of the URL is stored

I agree, but we can cross that bridge when we get there. Users with 5 HA instances will have to wait a bit :)

cyclops1982 commented 9 months ago

Note to self: do a rebase on main to resolve the conflict.

Habbie commented 9 months ago

I tested this, and it works. Perhaps we can always explicitly mention what kind of token we are giving the user.

Habbie commented 9 months ago

try to get old token if we have it. Not sure if old token thing is a good idea.

This does not currently work. I'm sure it could be made to work, but it's not worth it. Let's simplify that away and then merge :)

Habbie commented 9 months ago

(rest seems to work!)

Habbie commented 9 months ago

(rest seems to work!)

Uh, I take that back, it still can't find client-cli. Testing more.

Habbie commented 9 months ago

Ignore my last 3 comments, I was not testing the latest version. Long token works, re-print of long token works (which might be too old, but the user will find out soon enough. I guess we could verify that, but let's not overdo it.)