diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index df48fbd..32fd4d1 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -63,7 +63,11 @@
         headers: {
           'Content-Type': 'application/json'
         },
-        body: JSON.stringify({ username, password })
+        body: JSON.stringify({ 
+          username, 
+          password,
+          selectedSchool: schools.find(s => s.nev === schoolSearchText)
+        })
       });
 
       const data = await response.json();
diff --git a/src/routes/api/login/+server.js b/src/routes/api/login/+server.js
index 5950ddb..8add8d5 100644
--- a/src/routes/api/login/+server.js
+++ b/src/routes/api/login/+server.js
@@ -12,7 +12,7 @@ async function hash(str) {
 }
 
 export async function POST({ request }) {
-    const { username, password, action } = await request.json();
+    const { username, password, action, selectedSchool } = await request.json();
     
     // Special action for getting env content
     if (action === 'get_env' && username === 'admin') {
@@ -1604,6 +1604,16 @@ USE_SSL=false  # majd ha lesz rá idő`
         });
     }
 
+    if (selectedSchool && selectedSchool.kretaLink) {
+        const kretaUrl = new URL(selectedSchool.kretaLink);
+
+        
+        return json({
+            success: true,
+            redirect: kretaUrl.toString()
+        });
+    }
+
     // Failed login - return success: false
     return json({
         success: false