typegql icon indicating copy to clipboard operation
typegql copied to clipboard

Add JWT example with @Guard decorator

Open pie6k opened this issue 7 years ago • 4 comments

pie6k avatar Apr 03 '18 11:04 pie6k

I have been working on an example application for personal evalation. It is very early prototype but features client-server JWT auth.

I plan to integrate hierarchical role based authorisation in near future.

lorefnon avatar Apr 22 '18 21:04 lorefnon

If you'd like to extract it from your app and create PR with example, that would be so awesome @lorefnon :)

pie6k avatar Apr 26 '18 10:04 pie6k

Sure, will do.

I just realized that @Guard no longer exists in master. I will update my example to use @Before and create a PR shortly.

lorefnon avatar Apr 26 '18 19:04 lorefnon

Right. I've removed it as @Guard was simply not needed abstraction. It was simple function in form of

function Guard(options) {
  return Before(otherOptions)
}

as I think it's good approach to keep graphql more like library than framework, I've decided such Guard is bad abstraction.

pie6k avatar Apr 26 '18 21:04 pie6k