Comparing version 0.2.8 to 0.2.9
@@ -12,6 +12,9 @@ import { Context } from 'egg'; | ||
private moziBindRedirectUrl; | ||
private moziPrompt; | ||
private googleRedirectUrl; | ||
private googleBindRedirectUrl; | ||
private googlePrompt; | ||
private miniprogramRedirectUrl; | ||
private miniprogramBindRedirectUrl; | ||
private miniprogramPrompt; | ||
private loginRedirectUri; | ||
@@ -18,0 +21,0 @@ private unautorizedRedirectUri?; |
@@ -28,7 +28,7 @@ "use strict"; | ||
const state = this.formatState(userId ? { userId } : {}); | ||
url = await this.moziAuthenticator.authorizeURL(this.moziBindRedirectUrl, state); | ||
url = await this.moziAuthenticator.authorizeURL(this.moziBindRedirectUrl, state, this.moziPrompt); | ||
} | ||
else { | ||
const state = this.formatState({}); | ||
url = await this.moziAuthenticator.authorizeURL(this.moziRedirectUrl, state); | ||
url = await this.moziAuthenticator.authorizeURL(this.moziRedirectUrl, state, this.moziPrompt); | ||
} | ||
@@ -47,7 +47,7 @@ ctx.redirect(url); | ||
const state = this.formatState({ userId }); | ||
url = await this.googleAuthenticator.authorizeURL(this.googleBindRedirectUrl, state); | ||
url = await this.googleAuthenticator.authorizeURL(this.googleBindRedirectUrl, state, this.googlePrompt); | ||
} | ||
else { | ||
const state = this.formatState({}); | ||
url = await this.googleAuthenticator.authorizeURL(this.googleRedirectUrl, state); | ||
url = await this.googleAuthenticator.authorizeURL(this.googleRedirectUrl, state, this.googlePrompt); | ||
} | ||
@@ -65,7 +65,7 @@ ctx.redirect(url); | ||
const state = this.formatState({ userId }); | ||
url = await this.miniprogramAuthenticator.authorizeURL(this.miniprogramBindRedirectUrl, state); | ||
url = await this.miniprogramAuthenticator.authorizeURL(this.miniprogramBindRedirectUrl, state, this.miniprogramPrompt); | ||
} | ||
else { | ||
const state = this.formatState({}); | ||
url = await this.miniprogramAuthenticator.authorizeURL(this.miniprogramRedirectUrl, state); | ||
url = await this.miniprogramAuthenticator.authorizeURL(this.miniprogramRedirectUrl, state, this.miniprogramPrompt); | ||
} | ||
@@ -150,6 +150,9 @@ ctx.redirect(url); | ||
this.moziBindRedirectUrl = kauthConfig.origin + kauthConfig.moziBindUri; | ||
this.moziPrompt = kauthConfig.moziPrompt || 'auto'; | ||
this.googleRedirectUrl = kauthConfig.origin + kauthConfig.googleTokenUri; | ||
this.googleBindRedirectUrl = kauthConfig.origin + kauthConfig.googleBindUri; | ||
this.googlePrompt = kauthConfig.googlePrompt || ''; | ||
this.miniprogramRedirectUrl = kauthConfig.origin + kauthConfig.miniprogramTokenUri; | ||
this.miniprogramBindRedirectUrl = kauthConfig.origin + kauthConfig.miniprogramBindUri; | ||
this.miniprogramPrompt = kauthConfig.miniprogramPrompt || ''; | ||
this.loginRedirectUri = kauthConfig.loginRedirectUri; | ||
@@ -156,0 +159,0 @@ this.unautorizedRedirectUri = kauthConfig.unautorizedRedirectUri; |
@@ -0,1 +1,10 @@ | ||
## [0.2.9](https://gitlab-ag.marmot-cloud.com/marmot/kauth-sdk-egg/compare/v0.2.8...v0.2.9) (2020-10-29) | ||
### Bug Fixes | ||
* prompt ([973e7f7](https://gitlab-ag.marmot-cloud.com/marmot/kauth-sdk-egg/commit/973e7f7ef40d1beca30051762a866fa32837d725)) | ||
## [0.2.8](https://gitlab-ag.marmot-cloud.com/marmot/kauth-sdk-egg/compare/v0.2.7...v0.2.8) (2020-10-29) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "egg-kauth", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "egg kauth plugin", | ||
@@ -31,3 +31,3 @@ "eggPlugin": { | ||
"dependencies": { | ||
"kauth-sdk-node": "^0.1.3" | ||
"kauth-sdk-node": "^0.1.5" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
24962
470
Updatedkauth-sdk-node@^0.1.5