Merge pull request #1197 from mozilla/delete-old-refresh-tokens-1131
fix #1131: destroy old refresh tokens
This commit is contained in:
Коммит
21123768c3
4
db/DB.js
4
db/DB.js
|
@ -7,6 +7,7 @@ const Knex = require("knex");
|
|||
|
||||
const { FluentError } = require("../locale-utils");
|
||||
const AppConstants = require("../app-constants");
|
||||
const FXA = require("../lib/fxa");
|
||||
const HIBP = require("../hibp");
|
||||
const Basket = require("../basket");
|
||||
const getSha1 = require("../sha1-utils");
|
||||
|
@ -277,6 +278,9 @@ const DB = {
|
|||
})
|
||||
.returning("*");
|
||||
const updatedSubscriber = Array.isArray(updated) ? updated[0] : null;
|
||||
if (updatedSubscriber) {
|
||||
FXA.destroyOAuthToken({refresh_token: subscriber.fxa_refresh_token});
|
||||
}
|
||||
return updatedSubscriber;
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче