Skip to content

Commit ae6bba8

Browse files
committed
testing api keys
1 parent 7084149 commit ae6bba8

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

backend/index.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -932,13 +932,19 @@ app.put('/api/settings/active-location', requireAuth, async (req, res) => {
932932
app.get('/api/prodajna-mjesta', requireAuth, async (req, res) => {
933933
try {
934934
const locations = await prisma.prodajnoMjesto.findMany();
935+
// TODO: re-enable masking
936+
// const safeLocations = locations.map(loc => {
937+
// let maskedKey = "********";
938+
// try {
939+
// const real = decrypt(loc.firaApiKey);
940+
// maskedKey = `****${real.slice(-4)}`;
941+
// } catch { /* leave as ******** if decryption fails */ }
942+
// return { ...loc, firaApiKey: maskedKey };
943+
// });
935944
const safeLocations = locations.map(loc => {
936-
let maskedKey = "********";
937945
try {
938-
const real = decrypt(loc.firaApiKey);
939-
maskedKey = `****${real.slice(-4)}`;
940-
} catch { /* leave as ******** if decryption fails */ }
941-
return { ...loc, firaApiKey: maskedKey };
946+
return { ...loc, firaApiKey: decrypt(loc.firaApiKey) };
947+
} catch { return { ...loc, firaApiKey: "DECRYPTION_ERROR" }; }
942948
});
943949
res.json(safeLocations);
944950
} catch (error) {

0 commit comments

Comments
 (0)