allow grants to be updated
This commit is contained in:
parent
95d1c0284a
commit
ef43b56f1f
4
rest.js
4
rest.js
@ -186,8 +186,12 @@ module.exports.create = function (bigconf, deps, app) {
|
|||||||
return req.Store.find({ azpSub: req.body.sub });
|
return req.Store.find({ azpSub: req.body.sub });
|
||||||
}).then(function (existing) {
|
}).then(function (existing) {
|
||||||
if (existing.length) {
|
if (existing.length) {
|
||||||
|
if (existing.length > 1) {
|
||||||
|
throw new Error("pre-existing PPID collision detected");
|
||||||
|
} else if (existing[0].sub !== req.params.sub || existing[0].azp !== req.params.azp) {
|
||||||
throw new Error("PPID collision detected, cannot save authorized party's sub");
|
throw new Error("PPID collision detected, cannot save authorized party's sub");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var grant = {
|
var grant = {
|
||||||
sub: req.params.sub,
|
sub: req.params.sub,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user