mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #12880 from overleaf/em-hash-oauth-secrets-4
Hash secrets when creating OAuth clients GitOrigin-RevId: 5fb05bd825ceaabda635fe554a95879773aa3396
This commit is contained in:
parent
b0633b3a47
commit
8a0a67e2bb
1 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
|||
const minimist = require('minimist')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { waitForDb, db } = require('../../app/src/infrastructure/mongodb')
|
||||
const {
|
||||
hashSecret,
|
||||
} = require('../../modules/oauth2-server/app/src/SecretsHelper')
|
||||
|
||||
async function main() {
|
||||
const opts = parseArgs()
|
||||
|
@ -40,7 +43,7 @@ async function upsertApplication(opts) {
|
|||
updates.name = opts.name
|
||||
}
|
||||
if (opts.secret != null) {
|
||||
updates.clientSecret = opts.secret
|
||||
updates.clientSecret = hashSecret(opts.secret)
|
||||
}
|
||||
if (opts.grants != null) {
|
||||
updates.grants = opts.grants
|
||||
|
|
Loading…
Reference in a new issue