🐛 (nordigen) close window when opening /nordigen/link path (#160)

When Nordigen accounts are linked 2x windows get opened: 1x (initial
tab) is polling for the status; the other window is for authenticating
with bank. Once the auth is done - customer is redirected back to app:
`/nordigen/link` page. At this point we can just close the tab.


https://github.com/actualbudget/actual/issues/724#issuecomment-1462853590
This commit is contained in:
Matiss Janis Aboltins
2023-03-11 21:13:09 +00:00
committed by GitHub
parent 184ec5f1c0
commit 1dd1283d56
2 changed files with 23 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import express from 'express';
import path from 'path';
import { nordigenService } from './services/nordigen-service.js';
import {
@@ -10,6 +11,10 @@ import { handleError } from './util/handle-error.js';
import validateUser from '../util/validate-user.js';
const app = express();
app.get('/link', function (req, res) {
res.sendFile('link.html', { root: path.resolve('./src/app-nordigen') });
});
export { app as handlers };
app.use(express.json());
app.use(async (req, res, next) => {

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Actual</title>
</head>
<body>
<script>
window.close();
</script>
<p>Please wait...</p>
<p>
The window should close automatically. If nothing happened you can close
this window or tab.
</p>
</body>
</html>