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
|
||||
}
|
||||
|
||||
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 AuthButton from '../components/AuthButton.svelte';
|
||||
import { ToastsStore } from '../stores/toasts';
|
||||
import { user } from '../stores/user';
|
||||
|
||||
let auth = { username: "", password: "" };
|
||||
@ -17,6 +18,7 @@
|
||||
body: JSON.stringify(auth),
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.status == 200) {
|
||||
response.json().then((auth) => {
|
||||
pleaseWait = false;
|
||||
if (next && next.indexOf('//') === -1) {
|
||||
@ -25,17 +27,18 @@
|
||||
goto(".");
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch((response) => {
|
||||
} else {
|
||||
pleaseWait = false;
|
||||
if (response.data)
|
||||
response.json().then((data) => {
|
||||
ToastsStore.addToast({
|
||||
color: "danger",
|
||||
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) {
|
||||
@ -51,13 +54,13 @@
|
||||
<div class="row">
|
||||
<form class="col" on:submit|preventDefault={logmein}>
|
||||
<h2>Accès à votre compte</h2>
|
||||
<div class="mb-3">
|
||||
<label for="login" class="form-label">CRI login</label>
|
||||
<input class="form-control" id="login" bind:value={auth.username} placeholder="Entrer votre login" autofocus>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control" id="login" bind:value={auth.username} placeholder="xavier.login" autofocus>
|
||||
<label for="login">CRI login</label>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Mot de passe</label>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="password" class="form-control" id="password" bind:value={auth.password} placeholder="Mot de passe">
|
||||
<label for="password">Mot de passe</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-info">
|
||||
{#if pleaseWait}
|
||||
|
Reference in New Issue
Block a user