Skip to content

Commit 5b2c467

Browse files
committed
Update to SDK version v1.0.4
1 parent ddc2bba commit 5b2c467

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

complete/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>com.corbado</groupId>
2828
<artifactId>corbado-java</artifactId>
29-
<version>1.0.3</version>
29+
<version>1.0.4</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>org.springframework.boot</groupId>

complete/src/main/java/com/corbado/springboot/FrontendController.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class FrontendController {
3838
public FrontendController(
3939
@Value("${projectID}") final String projectID, @Value("${apiSecret}") final String apiSecret)
4040
throws StandardException {
41+
// Or use Config builder
4142
final Config config = new Config(projectID, apiSecret);
4243
this.sdk = new CorbadoSdk(config);
4344
}
@@ -66,29 +67,20 @@ public String profile(
6667
final Model model, @CookieValue("cbo_short_session") final String cboShortSession) {
6768
try {
6869
// Validate user from token
69-
7070
final SessionValidationResult validationResp =
7171
sdk.getSessions().getAndValidateCurrentUser(cboShortSession);
7272

73-
if (validationResp.getError() != null) {
74-
// Handle invalid token. In this case we will forward the error message to the page.
75-
throw validationResp.getError();
76-
}
77-
7873
// get list of emails from identifier service
7974
List<Identifier> emails;
80-
8175
emails = sdk.getIdentifiers().listAllEmailsByUserId(validationResp.getUserID());
82-
83-
//
8476
model.addAttribute("PROJECT_ID", projectID);
8577
model.addAttribute("USER_ID", validationResp.getUserID());
8678
model.addAttribute("USER_NAME", validationResp.getFullName());
8779
// select email of your liking or list all emails
8880
model.addAttribute("USER_EMAIL", emails.get(0).getValue());
8981

9082
} catch (final Exception e) {
91-
System.out.println(e.getMessage());
83+
//Handle verification errors here
9284
model.addAttribute("ERROR", e.getMessage());
9385
return "error";
9486
}

0 commit comments

Comments
 (0)