Fixed issue when creating new users

This commit is contained in:
George Kalampokis 2020-05-04 17:19:23 +03:00
parent 5d6fbd3e37
commit f397ce6c72
2 changed files with 10 additions and 4 deletions

View File

@ -134,10 +134,10 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
.name(profile.getName()).verified_email(profile.getIsVerified()) .name(profile.getName()).verified_email(profile.getIsVerified())
.email(profile.getEmail()).created(new Date()).lastloggedin(new Date()) .email(profile.getEmail()).created(new Date()).lastloggedin(new Date())
.additionalinfo("{\"data\":{\"avatar\":{\"url\":\"" + profile.getAvatarUrl() .additionalinfo("{\"data\":{\"avatar\":{\"url\":\"" + profile.getAvatarUrl()
+ "\"}},{\"zenodoToken\":\"" + profile.getZenodoId() + "\"},\"zenodoToken\":\"" + profile.getZenodoId()
+ "\", \"expirationDate\": \"" + Instant.now().plusSeconds(profile.getZenodoExpire()).toEpochMilli() + "\", \"expirationDate\": \"" + Instant.now().plusSeconds((profile.getZenodoExpire() != null ? profile.getZenodoExpire(): 0)).toEpochMilli()
+ "\", \"zenodoRefresh\": \"" + profile.getZenodoRefresh() + "\", \"zenodoRefresh\": \"" + profile.getZenodoRefresh()
+ (profile.getProvider() == TokenValidatorFactoryImpl.LoginProvider.ZENODO ? "\", \"zenodoEmail\": \"" + profile.getEmail() : "") +"\"}") + (profile.getProvider() == TokenValidatorFactoryImpl.LoginProvider.ZENODO ? "\", \"zenodoEmail\": \"" + profile.getEmail() : "") +"\"}}")
.authorization_level((short) 1).usertype((short) 1) .authorization_level((short) 1).usertype((short) 1)
.build(); .build();

View File

@ -14,4 +14,10 @@ ALTER TABLE public."DatasetProfile"
ADD COLUMN "Version" integer; ADD COLUMN "Version" integer;
ALTER TABLE public."Grant" ALTER TABLE public."Grant"
ADD COLUMN "Type" numeric NOT NULL; ADD COLUMN "Type" numeric NOT NULL;
ALTER TABLE public."DatasetDataRepository"
ADD COLUMN "Data" character varying;
ALTER TABLE public."DatasetService"
ADD COLUMN "Data" character varying;