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

Authorization with expired token should return different message than authorizing with no token #201

Open
zelitomas opened this issue Feb 12, 2021 · 2 comments
Assignees
Labels
bug Something isn't working feedback needed

Comments

@zelitomas
Copy link
Collaborator

zelitomas commented Feb 12, 2021

$ echo $TOKEN
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJsb2NhbGhvc3QiLCJpYXQiOjE2MTMwNjkxMDAsImV4cCI6MTYxMzA3MDkwMCwianRpIjoiNjAyNTdiMmMxOGJlMyIsInN1YiI6ImFkbWluQGEuY3oiLCJnX3VpZCI6MSwiZ19haWQiOjF9.pxTpsYAyygP_bsxvP_70u6SY-IiV4OrUL8BJdBPo1xe8XkmPQBrLTUCXJRsquDzchRX_11vUb0IHj7nQ8FPNpg

$ curl -k -H "Authorization: Bearer ${TOKEN}" -F 'actual_dir=fin' -F 'file[]=@./file1.txt' ${HOST}/api/stor/v1/upload
{
    "api": "core/auth/jwt",
    "version": "1",
    "response_ts": 1613090730,
    "response_id": "6025cfaac9495",
    "status": "Forbidden.",
    "message": "You must be signed in to do this, please provide a valid token.",
    "code": 403
}
@killua-eu killua-eu self-assigned this Feb 12, 2021
@killua-eu killua-eu added the bug Something isn't working label Feb 12, 2021
@killua-eu
Copy link
Contributor

killua-eu commented Feb 12, 2021

TODO: On expired tokens, change code to 401, return relevant message.

@killua-eu
Copy link
Contributor

Per https://github.com/vaizard/glued-skeleton/commit/318a5afe8822408e821a35df78e825d3b2f5652f#diff-bcc1e50439cf4f7a7e858a7ce8c473ee898c85d4a7549386ed47993bc9886d89R78 the behavior can now be modified. Still keeping to 403 error code, on expiry appending (expired) to the message. Suggestions on how to make this comfy as fuck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback needed
Projects
None yet
Development

No branches or pull requests

2 participants