relayjs: authentication using relay, which mutation to use?

前端 未结 3 678
感动是毒
感动是毒 2021-02-13 13:10

I am currently handling authentication outside of relay with custom header set in DefaultNetworkLayer. Is it preferred way and Is there a way to do it in relay? I was stuck when

3条回答
  •  我寻月下人不归
    2021-02-13 13:29

    Relay is intentionally agnostic about authentication mechanisms, so using a custom header via the network layer is appropriate.

    As for how to handle the post-login response, it's probably best to trigger a full page refresh or a redirect at that point, because Relay doesn't currently have a way to reset all internal state (although it is on the list of desirable items). Given that viewer identity can so drastically affect item visibility, a full reset is pretty much required in order to maintain correct/robust behavior.

提交回复
热议问题