This commit is contained in:
@ -49,7 +49,7 @@ export const setup = async () => {
|
||||
|
||||
config.custom.postRouting(server)
|
||||
|
||||
/*
|
||||
if(process.env["UNIT_TEST"] || process.env["DEVEL_FIRST_RUN"]) {
|
||||
// Create a test player
|
||||
await new models.Player({
|
||||
username: 'test',
|
||||
@ -63,7 +63,7 @@ export const setup = async () => {
|
||||
registerDate: Date.now(),
|
||||
permissions: [{ node: 'login', allowed: true, duration: 0, eternal: true, startDate: Date.now(), highPriority: false }]
|
||||
}).save()
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
const launch = async () => {
|
||||
|
@ -2,6 +2,7 @@ import { PNG } from 'pngjs'
|
||||
import fs from 'fs'
|
||||
import { createHash, createPrivateKey, createSign } from 'crypto'
|
||||
import { config } from './config.js'
|
||||
import { server } from './index.js'
|
||||
|
||||
export const ImageSecurity = {
|
||||
createImageHash: async (path, isCape) => {
|
||||
@ -70,7 +71,7 @@ export const ImageSecurity = {
|
||||
throw new Error('Invalid image size')
|
||||
},
|
||||
sign: async (data) => {
|
||||
return createSign('RSA-SHA1').update(data).sign(createPrivateKey(config.privateKey), 'hex')
|
||||
return createSign('RSA-SHA1').update(data).sign({ key: createPrivateKey(server.keys.privateKey) }, 'hex')
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user