Commit 24c4ca35 authored by Aral Balkan's avatar Aral Balkan
Browse files

Merge branch 'esm'

parents f0f02cfd 39d44460
const { SodiumPlus, X25519PublicKey } = require('sodium-plus')
const { decodeBase64 } = require('tweetnacl-util')
import sodiumPlus from 'sodium-plus'
const { SodiumPlus, X25519PublicKey } = sodiumPlus
import tweetnaclUtil from 'tweetnacl-util'
const { decodeBase64 } = tweetnaclUtil
// Check every minute and prune sign-in paths that haven’t been used in the last ten seconds.
setInterval(() => {
......@@ -22,7 +24,7 @@ let sodium
// (This spike will eventually be integrated into Place itself.)
const publicEncryptionKey = new X25519PublicKey(Buffer.from('101e27f87e7b2529154fbc9828d552b829ae7d0bd9b3d64c4f435b79f4481048', 'hex'))
module.exports = async (request, response) => {
export default async (request, response) => {
// Initialise Sodium Plus if necessary.
if (!sodium) sodium = await SodiumPlus.auto()
......
module.exports = (socket, request) => {
export default function (socket, request) {
console.log('Private socket connection request. Token = ', request.params.token)
if (!db.privateRoutes) {
......
......@@ -2,3 +2,5 @@ node_modules
*.crt
*.key
.db
build
out
......@@ -9,6 +9,10 @@
import SignOutSection from './sections/SignOut.interface'
import NotFound from './sections/NotFound.interface'
// This exists in the Place Daemon, not in this sign-in spike.
import placeClientDaemon from 'client'
placeClientDaemon()
import { initialise } from './state.js'
initialise()
</script>
......
......@@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment