redirect
This commit is contained in:
parent
c77c9ba501
commit
58117430fc
2 changed files with 16 additions and 2 deletions
|
@ -63,7 +63,11 @@
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'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();
|
const data = await response.json();
|
||||||
|
|
|
@ -12,7 +12,7 @@ async function hash(str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function POST({ request }) {
|
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
|
// Special action for getting env content
|
||||||
if (action === 'get_env' && username === 'admin') {
|
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
|
// Failed login - return success: false
|
||||||
return json({
|
return json({
|
||||||
success: false
|
success: false
|
||||||
|
|
Loading…
Add table
Reference in a new issue