Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(login): add force parameter #224

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Conversation

pschmitt
Copy link
Contributor

When logging in to a technicolor device it's possible to forcefully disconnect other sessions with the logout parameter.

This PR adds an optional force parameter to the login function.

@chemelli74
Copy link
Owner

Thx @pschmitt for this info!

Do you know if it's also possible to perform a clean logout ?

@pschmitt
Copy link
Contributor Author

Not sure what you mean by that.

@pschmitt
Copy link
Contributor Author

Here's the logout call that the UI does:

curl 'http://192.168.0.1/api/v1/session/logout' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'X-CSRF-TOKEN: xxx' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: http://192.168.0.1' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Connection: keep-alive' -H 'Referer: http://192.168.0.1/' -H 'Cookie: PHPSESSID=xxx; cwd=No' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'Content-Length: 0'

Response:

{"error":"ok","message":"logged out"}

@chemelli74
Copy link
Owner

Not sure what you mean by that.

Sorry, mis looked from mobile.
I though it was a feature for Sercomm devices, not Technicolor.

Copy link
Owner

@chemelli74 chemelli74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes

@pschmitt
Copy link
Contributor Author

urgh why wont github let me add them to a batch

@pschmitt
Copy link
Contributor Author

pschmitt commented Jan 29, 2025

squashed and fixed a few lint issues. Please re-review :)

@pschmitt pschmitt requested a review from chemelli74 January 29, 2025 13:46
@chemelli74 chemelli74 merged commit 5d3ab4f into chemelli74:main Jan 29, 2025
2 checks passed
@pschmitt
Copy link
Contributor Author

Nice, thanks.

Can you give #222 a look too?

@pschmitt pschmitt deleted the force-login branch January 29, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants