New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

egg-kauth

Package Overview
Dependencies
Maintainers
0
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-kauth - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3-alpha.1

27

app/lib/index.js

@@ -187,4 +187,11 @@ "use strict";

fallback = async (ctx, next) => {
// verify
const token = ctx.cookies.get(this.authCookieName);
// 优先从 cookie 中获取 token
let token = ctx.cookies.get(this.authCookieName);
let setCookie = true;
// 如果没有 token,则从 header 中获取
if (!token) {
token = ctx.get(this.authCookieName);
// 如果从 header 中获取到 token,则不再设置 cookie
setCookie = !token;
}
let sub;

@@ -203,5 +210,7 @@ if (this.authHandler) {

await this.authHandler(ctx, sub);
const refreshedToken = this.subjectProvider.refresh(token);
if (refreshedToken) {
this.saveJsonWebTokenToHeader(ctx, refreshedToken);
if (setCookie) {
const refreshedToken = this.subjectProvider.refresh(token);
if (refreshedToken) {
this.saveJsonWebTokenToHeader(ctx, refreshedToken);
}
}

@@ -222,5 +231,7 @@ }

this.saveAuthenticationInformationToContext(ctx, authenticationInformation);
const refreshedToken = this.jwtProvider.refresh(token);
if (refreshedToken) {
this.saveJsonWebTokenToHeader(ctx, refreshedToken);
if (setCookie) {
const refreshedToken = this.jwtProvider.refresh(token);
if (refreshedToken) {
this.saveJsonWebTokenToHeader(ctx, refreshedToken);
}
}

@@ -227,0 +238,0 @@ }

{
"name": "egg-kauth",
"version": "3.0.2",
"version": "3.0.3-alpha.1",
"description": "egg kauth plugin",

@@ -5,0 +5,0 @@ "eggPlugin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc