From 0af3ccbe9c7b32c710b19dbd698ecd7508d06c22 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 20 Apr 2022 08:58:32 +0200 Subject: [PATCH] Styling --- peertube-plugin-auth-saml2/main.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/peertube-plugin-auth-saml2/main.js b/peertube-plugin-auth-saml2/main.js index 1e83edd..7ea6d2e 100644 --- a/peertube-plugin-auth-saml2/main.js +++ b/peertube-plugin-auth-saml2/main.js @@ -328,16 +328,17 @@ async function buildUser (settingsManager, samlUser) { let username = findInUser(samlUser, settings['username-property']) || '' username = username.replace(/[^a-z0-9._]/g, '_') - let sent_role = findInUser(samlUser, settings['role-property']) - let parsed_role = parseInt(sent_role, 10) - if (!Number.isSafeInteger(parsed_role)) { - parsed_role = undefined + let sentRole = findInUser(samlUser, settings['role-property']) + let parsedRole = parseInt(sentRole, 10) + + if (!Number.isSafeInteger(parsedRole)) { + parsedRole = undefined } return { username, email: findInUser(samlUser, settings['mail-property']), displayName: findInUser(samlUser, settings['display-name-property']), - role: parsed_role + role: parsedRole } }