koajs / userauth

koa user auth middleware
MIT License
137 stars 18 forks source link

[feat] fetch get json request return 403 not 302 #40

Open shaozj opened 1 year ago

shaozj commented 1 year ago

Describe the feature

When we use fetch to get json data from server,userauth return 302 with redirect url。Fetch will throw TypeError: failed to fetch caused by cors error. It's better to throw 403 with login expired message to make frontend do the re-login easily.