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

Authentication jwt and PostGUI #56

Open
bmgante opened this issue Sep 2, 2022 · 2 comments
Open

Authentication jwt and PostGUI #56

bmgante opened this issue Sep 2, 2022 · 2 comments

Comments

@bmgante
Copy link

bmgante commented Sep 2, 2022

Hi all,

I am trying to setup a PostGUI (https://github.com/priyank-purohit/PostGUI) which makes use of postgrest but getting struggled with jwt authentication.

Does anyone here has some kind of experience with this app? I did the config as mentioned in POSTGUI read me but when i click on login button nothing happens... at postgrest logs i can see that the post /rpc/login succeeds but at postgui application level nothing happens (and there are no logs!).

Example of a manual post to /rpc/login:

TRUT10236:network-catalog-ui-api bruno.gante$ curl -X 'POST' 'http://127.0.0.1:3000/rpc/login' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"email": "[email protected]", "pass": "CHNAGME123"}'
{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiZWRpdHVzZXIiLCJlbWFpbCI6ImFkbWluQGRvbWFpbi5jb20iLCJleHAiOjE2NjIxMjMwNjd9.INmxG3p0k5rFvOqfzh0pqsNmUGw6TYaZvJPAWTXeT3o"}
Example of postgrest log when i try to login in PostGUI with valid credentials:

172.18.0.1 - - [02/Sep/2022:11:38:53 +0000] "POST /rpc/login HTTP/1.1" 200 - "http://localhost:8771/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

Example of postgrest log when i try to login in PostGUI with invalid credentials:

172.18.0.1 - - [02/Sep/2022:11:59:22 +0000] "POST /rpc/login HTTP/1.1" 403 - "http://localhost:8771/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

Is there someone here that could help please? @priyank-purohit @erjanmx

Thanks

@bmgante
Copy link
Author

bmgante commented Sep 2, 2022

image
image

@bmgante
Copy link
Author

bmgante commented Sep 6, 2022

Fixed the problem. There is an issue on master branch
Auth.js line 84: change from "let data = rawResp.data[0];" to "let data = rawResp.data;"

I am now facing another issue when selecting rows from table to delete.
DataTable.js line 594: let changedRowPkStr = primaryKey.join(""); ---> primaryKey here is a string and join function is only applicable to arrays. Do not really now how to address this yes, any idea?

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

No branches or pull requests

1 participant