Code Monkey home page Code Monkey logo

Comments (4)

koo5 avatar koo5 commented on June 20, 2024
  • need to make hasura recognize the jwt that our server signed
  • need to click on the right icons in hasura admin to allow some operations and disallow others, based on user id
  • check that our server checks the jwt that our server signed

from koordinator2000.

koo5 avatar koo5 commented on June 20, 2024

so, the jwt method isnt possible with nhost, so, i'd probably wait for when nhost has a svelte api, and then use their autho

from koordinator2000.

koo5 avatar koo5 commented on June 20, 2024

koo5
:
so here's my problem: i have a fairly nonstandard idea about how authentication should work in my app. Any browser that comes to the website, my js code make a call to my node backend, which generates a user id, signs a jwt with that id, and sends it back. The token is saved in browser localstorage. As long as the user doesn't delete it or something, they are in possession of it. If they use the site for some time, it nags them to authenticate with google/whatever. When they do, i save the association into the db, so that at a later time, when they authenticate again, my backend finds this association and signs a jwt again, effectively logging the original user in. When i used hasura.io and auth0, i could do this (it's not fully implemented but principially i think), because hasura.io lets me specify the pubkey that hasura would use to verify tokens - i'd set it to correspond to the privkey that my node backend has.
[
7:35 PM
]
koo5
:
so.. (sorry for the word salad), does this sound like a scenario that the nhost auth api could support?
[
7:35 PM
]
elitan
:
@koo5 Yea we support that out of the box
[
7:36 PM
]
elitan
:
Do you have any specific issue? What frontend framework do you use?
[
7:36 PM
]
elitan
:
You might be interested in: https://github.com/nhost/nhost/tree/main/examples
[
7:42 PM
]
koo5
:
@elitan oh, gotta admit, i haven't studied the examples. All of them do this, localstorage and everything? I use svelte.
[
8:00 PM
]
koo5
:
ok, i see nhostRefreshToken, so far so good
[
8:01 PM
]
koo5
:
i guess i'd have to call the registration endpoint with some dummy email/username/password though?
[
8:04 PM
]
elitan
:
Yes

from koordinator2000.

koo5 avatar koo5 commented on June 20, 2024

POC /login done.
now if we could tell nhost to redirect to the original url rather than having to have a fixed one in settings
another option is i guess to spawn a second, dev, nhost project, for localhost testing

from koordinator2000.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.