Closed danielmewes closed 8 years ago
@deontologician - if it's possible to write up a paragraph or so about how to use this, it'd be really helpful. (cc @Tryneus)
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
Ok, so now we have rethinkdb/horizon#429 published, so it's ok to talk about it.
Basic process:
horizon('users').store({ id: <SOME_USER_ID> })
hz make-token <SOME_USER_ID>
possibly passing connect options to make-tokenvar 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
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).
Having to document this is really pointing out how terrible this process is
the
hz make-token
command is going to be added via https://github.com/rethinkdb/horizon/pull/390