From 508251ce309d8ff65c90f369bf724cae3c728e34 Mon Sep 17 00:00:00 2001 From: Vitomir Budimir Date: Mon, 22 Jul 2024 21:20:56 +0200 Subject: [PATCH] fix: vidis logic --- modules/kratos/vidis_user_mapper.jsonnet | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/kratos/vidis_user_mapper.jsonnet b/modules/kratos/vidis_user_mapper.jsonnet index b9584d3..a32a3b7 100644 --- a/modules/kratos/vidis_user_mapper.jsonnet +++ b/modules/kratos/vidis_user_mapper.jsonnet @@ -24,14 +24,14 @@ local buildUsername = function() local checkIfIsTeacher = function() local rawClaims = extractFromClaims('raw_claims'); - if 'rolle' in rawClaims then rawClaims['rolle'] == 'LEHR' else false; + if 'rolle' in rawClaims then rawClaims['rolle'] != 'LEHR' else false; -{ - identity: if checkIfIsTeacher() then { +if checkIfIsTeacher() then { + identity: { traits: { email: buildEmail(), username: buildUsername(), interest: 'other', }, - } else error std.format("ERR_BAD_ROLE"), -} + }, +} else error "ERR_BAD_ROLE"