Skip to content

Commit

Permalink
replaced tabs with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Oct 3, 2024
1 parent 81d0ee0 commit 96fab76
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/main/java/edu/harvard/iq/dataverse/api/OpenIDCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@ public class OpenIDCallback extends AbstractApiBean {
@Inject
OpenIdContext openIdContext;

@Inject
@Inject
protected AuthenticationServiceBean authSvc;

@Path("token")
@GET
public Response token(@Context ContainerRequestContext crc) {
return Response.seeOther(crc.getUriInfo().getBaseUri().resolve("callback/session")).build();
}
@Path("token")
@GET
public Response token(@Context ContainerRequestContext crc) {
return Response.seeOther(crc.getUriInfo().getBaseUri().resolve("callback/session")).build();
}

@Path("session")
@GET
public Response session(@Context ContainerRequestContext crc) {
final String email = openIdContext.getAccessToken().getJwtClaims().getStringClaim("email").orElse(null);
final AuthenticatedUser authUser = authSvc.getAuthenticatedUserByEmail(email);
final JsonObjectBuilder userJson;
@Path("session")
@GET
public Response session(@Context ContainerRequestContext crc) {
final String email = openIdContext.getAccessToken().getJwtClaims().getStringClaim("email").orElse(null);
final AuthenticatedUser authUser = authSvc.getAuthenticatedUserByEmail(email);
final JsonObjectBuilder userJson;
if (authUser != null) {
userJson = authUser.toJson();
userJson = authUser.toJson();
} else {
userJson = null;
}
return ok(
jsonObjectBuilder()
.add("user", userJson)
.add("session", crc.getCookies().get("JSESSIONID").getValue())
);
}
userJson = null;
}
return ok(
jsonObjectBuilder()
.add("user", userJson)
.add("session", crc.getCookies().get("JSESSIONID").getValue())
);
}
}

0 comments on commit 96fab76

Please sign in to comment.