Fix connection through Kerberos
Some checks are pending
continuous-integration/drone/push Build is running
Some checks are pending
continuous-integration/drone/push Build is running
This commit is contained in:
parent
b572938283
commit
60540a1631
@ -80,5 +80,10 @@ func checkAuthKrb5(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
completeAuth(c, lf.Login, lf.Login+"@epita.fr", "", "", "", nil)
|
if usr, err := completeAuth(c, lf.Login, lf.Login+"@epita.fr", "", "", "", nil); err != nil {
|
||||||
|
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"errmsg": err.Error()})
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
c.JSON(http.StatusOK, authToken{User: usr, CurrentPromo: currentPromo})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
|
|
||||||
import AuthButton from '../components/AuthButton.svelte';
|
import AuthButton from '../components/AuthButton.svelte';
|
||||||
|
import { ToastsStore } from '../stores/toasts';
|
||||||
import { user } from '../stores/user';
|
import { user } from '../stores/user';
|
||||||
|
|
||||||
let auth = { username: "", password: "" };
|
let auth = { username: "", password: "" };
|
||||||
@ -17,6 +18,7 @@
|
|||||||
body: JSON.stringify(auth),
|
body: JSON.stringify(auth),
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
if (response.status == 200) {
|
||||||
response.json().then((auth) => {
|
response.json().then((auth) => {
|
||||||
pleaseWait = false;
|
pleaseWait = false;
|
||||||
if (next && next.indexOf('//') === -1) {
|
if (next && next.indexOf('//') === -1) {
|
||||||
@ -25,17 +27,18 @@
|
|||||||
goto(".");
|
goto(".");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
} else {
|
||||||
.catch((response) => {
|
|
||||||
pleaseWait = false;
|
pleaseWait = false;
|
||||||
if (response.data)
|
response.json().then((data) => {
|
||||||
ToastsStore.addToast({
|
ToastsStore.addToast({
|
||||||
color: "danger",
|
color: "danger",
|
||||||
title: "Connexion impossible",
|
title: "Connexion impossible",
|
||||||
msg: (response.data ? response.data.errmsg : "Impossible de contacter le serveur"),
|
msg: (data ? data.errmsg : "Impossible de contacter le serveur"),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if ($user && $user.id) {
|
if ($user && $user.id) {
|
||||||
@ -51,13 +54,13 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<form class="col" on:submit|preventDefault={logmein}>
|
<form class="col" on:submit|preventDefault={logmein}>
|
||||||
<h2>Accès à votre compte</h2>
|
<h2>Accès à votre compte</h2>
|
||||||
<div class="mb-3">
|
<div class="form-floating mb-3">
|
||||||
<label for="login" class="form-label">CRI login</label>
|
<input type="text" class="form-control" id="login" bind:value={auth.username} placeholder="xavier.login" autofocus>
|
||||||
<input class="form-control" id="login" bind:value={auth.username} placeholder="Entrer votre login" autofocus>
|
<label for="login">CRI login</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="form-floating mb-3">
|
||||||
<label for="password" class="form-label">Mot de passe</label>
|
|
||||||
<input type="password" class="form-control" id="password" bind:value={auth.password} placeholder="Mot de passe">
|
<input type="password" class="form-control" id="password" bind:value={auth.password} placeholder="Mot de passe">
|
||||||
|
<label for="password">Mot de passe</label>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-info">
|
<button type="submit" class="btn btn-info">
|
||||||
{#if pleaseWait}
|
{#if pleaseWait}
|
||||||
|
Reference in New Issue
Block a user