We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if (!this.session) { debug('this.session not exists'); // ignore not match path if (!loginRequired) { debug('not match needLogin path, %j', this.path); return yield next; } debug('relogin again'); return yield loginHandler.call(this, next); } // get login path if (this.path === options.loginPath) { debug('match login path'); return yield loginHandler.call(this, next); }
场景: 当 loginPath=/login loginHost=demo.xxx.com 浏览器中输入demo.xxx.com/login (带有部分cookie),这是就能跳过第一个判断if (!this.session) 而 if (this.path === options.loginPath) 符合条件! 最终就会执行到loginHandler 的 redirect(this, loginURL); @fengmk2
The text was updated successfully, but these errors were encountered:
这种 userauth 无法解决的。
Sorry, something went wrong.
if (!loginRequired) { debug('not match needLogin path, %j', this.path); return yield next; }
这段拎出来呢?/login加入白名单,让他直接跳到下一个中间件
或者这样?
if (!this.session) to if (!this.session || !this.session[options.userField])
No branches or pull requests
场景:
当
loginPath=/login
loginHost=demo.xxx.com
浏览器中输入demo.xxx.com/login (带有部分cookie),这是就能跳过第一个判断if (!this.session)
而 if (this.path === options.loginPath) 符合条件!
最终就会执行到loginHandler 的 redirect(this, loginURL);
@fengmk2
The text was updated successfully, but these errors were encountered: