go-shiori/shiori

Route /api/login not available

pettersillander opened this issue · 8 comments

Data

  • 1.6.0-rc.6:

Describe the bug / actual behavior

It seems there's no route for /api/login currently.

Expected behavior

Http client should be able use /api/login to authenticate session

To Reproduce

curl http://example.com/api/login -d {"login details"} -> 404

Notes

This (/api/login) route is in API.md. But for api auth one would still need to use only api/v1/auth/login endpoint it seems.

Maybe there should be a notice in the api docs or is this going to change soon?

we move to api/v1/auth/login and for new api i suggest review this https://github.com/go-shiori/shiori/blob/master/docs/APIv1.md for login and we remove that for v1.6
we plan that to update documentation here in #663
if you think it should not close please mention here.

Sorry, I mixed old and new api. v1 is the new one, not other way round. Thanks, all good then.

I'm getting the opposite error and different issue. http://desktop.lan/api/v1/auth/login doesn't exist but the older API does. When I call it I get a 200, but the expiration date is when it's sent. Therefore I can never get a valid session id. Running the windows x64 binary from here: shiori_Windows_x86_64.tar.gz. Any thoughts? Is there a way I can just use the CLI to change the master password?

Running server with .\shiori.exe serve --portable

POST http://desktop.lan/api/login HTTP/1.1
content-type: application/json

{
	"username": "shiori",
	"password": "gopher",
	"remember": true,
	"owner": true
}
HTTP/1.1 200 OK
Server: nginx/1.24.0
Date: Sun, 18 Feb 2024 16:16:37 GMT
Content-Type: application/json
Content-Length: 145
Connection: close

{
  "session": "XXXX",
  "account": {
    "id": 0,
    "username": "shiori",
    "owner": true
  },
  "expires": "Sun, 18 Feb 2024 17:16:37 UTC"
}

Which version?
please add command that use to run server?

Which version? please add command that use to run server?

Version of...? I gave a link to the release I'm using above if that's what you were looking for.

EDIT: I don't even see the default account in the sqlite dB...just the read only account I created. Is there some other place to change it?

I don't acsses to my system right now.
Can you please run shiori with server instead of serve
About the user as I remmmber we change the way default user work and not have that in database anymore.

I don't acsses to my system right now. Can you please run shiori with server instead of serve About the user as I remmmber we change the way default user work and not have that in database anymore.

.\shiori.exe server --portable
Error: unknown command "server" for "shiori"

Did you mean this?
        serve

Run 'shiori --help' for usage.
time="2024-02-18T14:38:46-08:00" level=fatal msg="unknown command \"server\" for \"shiori\"\n\nDid you mean this?\n\tserve\n"

I want to basically disable that default username and password, so let me know how to do that. Either delete that account, change the password, or...

I don't acsses to my system right now. Can you please run shiori with server instead of serve About the user as I remmmber we change the way default user work and not have that in database anymore.

.\shiori.exe server --portable
Error: unknown command "server" for "shiori"

Did you mean this?
        serve

Run 'shiori --help' for usage.
time="2024-02-18T14:38:46-08:00" level=fatal msg="unknown command \"server\" for \"shiori\"\n\nDid you mean this?\n\tserve\n"

I want to basically disable that default username and password, so let me know how to do that. Either delete that account, change the password, or...

OK i finally test that my self
new API activate for login in v1.6 not v1.5.5.
about default user. when you login with default user name (shiori) and password (gopher) go to the settings and add new account as owner (default username and password will disable automatically after your create first real account in settings)
change password and other things available in settings too.