Skip to content

Commit 3052984

Browse files
authored
Implement user verification on Raspberry Pi
Add user verification function for Raspberry Pi.
1 parent c22980c commit 3052984

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

services/geminiService.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,19 @@ export const generatePodcastAudio = async (text: string) => {
7777
console.log("Generuji audio pro:", text);
7878
return "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3";
7979
};
80+
81+
export const verifyUserOnRPi = async (name: string, pass: string) => {
82+
try {
83+
const response = await fetch(`${TUNNEL_URL}/api/auth`, { // Nový endpoint na malině
84+
method: 'POST',
85+
headers: { 'Content-Type': 'application/json' },
86+
body: JSON.stringify({ name, pass })
87+
});
88+
89+
const data = await response.json();
90+
return data.success; // Malina vrátí true nebo false
91+
} catch (error) {
92+
console.error("Chyba při ověřování na RPi:", error);
93+
return false;
94+
}
95+
};

0 commit comments

Comments
 (0)