Giter Site home page Giter Site logo

Comments (5)

chipotle avatar chipotle commented on August 15, 2024

@deontologician - if it's possible to write up a paragraph or so about how to use this, it'd be really helpful. (cc @Tryneus)

from horizon-docs.

deontologician avatar deontologician commented on August 15, 2024

Hmm, this is actually kinda crappy at the moment. I'm not sure we should document this until rethinkdb/horizon#429 is completed, since otherwise you need to use an internal api I'd rather not suggest in the docs.

I'm going to open another issue in the horizon repo to get some input on how exactly we should get this flow to work, since it's not obvious

from horizon-docs.

deontologician avatar deontologician commented on August 15, 2024

Ok, so now we have rethinkdb/horizon#429 published, so it's ok to talk about it.

Basic process:

  1. With your admin user, do a horizon('users').store({ id: <SOME_USER_ID> })
  2. Now, go to the command line, use hz make-token <SOME_USER_ID> possibly passing connect options to make-token
  3. Copy the token that is printed out on the commandline
  4. Pass that token to your next creation of a Horizon object:
var horizon = Horizon({ authType: { token: <TOKEN_HERE>, storeLocally: true/false }})

token is the user token to log in as
storeLocally is whether horizon should try to preserve the token in localStorage so you don't have to pass it the next time you want to log in

from horizon-docs.

danielmewes avatar danielmewes commented on August 15, 2024

With your admin user [...]

We'll need to explain that step too (it works as Josh described, just without step 1 and with admin instead of <SOME_USER_ID> in step 2 as far as I know).

from horizon-docs.

deontologician avatar deontologician commented on August 15, 2024

Having to document this is really pointing out how terrible this process is

from horizon-docs.

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.