Version 0.2.0 - PREVERSION - Ajout de certaines fonctionnalités
All checks were successful
Neutral/pipeline/head This commit looks good

This commit is contained in:
Raphix
2023-11-02 18:16:15 +01:00
parent a3e0f25968
commit 9c1074de80
17 changed files with 888 additions and 18 deletions

View File

@ -23,7 +23,6 @@ module.exports.check = function(token) {
})
if(isApproved) {
alog.log("Connexion par Token de l'utilisateur : " + username)
return true
} else {
if(token) {
@ -88,4 +87,27 @@ module.exports.signout = function(token) {
return false
}
}
module.exports.getUserByToken = function(token) {
var isApproved = false;
var userGetted = null
users.getUsers().forEach((fetchUser) => {
if(fetchUser.tokens.includes(token)) {
userGetted = fetchUser
}
})
if(userGetted) {
return userGetted
} else {
if(token) {
alog.warn("Erreur d'authentification - Token n'existe pas : " + token)
}
return false
}
}