Search in sources :

Example 1 with EmailVerificationStatus

use of org.sagebionetworks.bridge.services.EmailVerificationStatus in project BridgeServer2 by Sage-Bionetworks.

the class AppController method verifySenderEmail.

@PostMapping(path = { "/v1/apps/self/verifyEmail", "/v3/studies/self/verifyEmail" })
public EmailVerificationStatusHolder verifySenderEmail() {
    UserSession session = getAuthenticatedSession(DEVELOPER);
    App app = appService.getApp(session.getAppId());
    EmailVerificationStatus status = emailVerificationService.verifyEmailAddress(app.getSupportEmail());
    return new EmailVerificationStatusHolder(status);
}
Also used : App(org.sagebionetworks.bridge.models.apps.App) UserSession(org.sagebionetworks.bridge.models.accounts.UserSession) EmailVerificationStatus(org.sagebionetworks.bridge.services.EmailVerificationStatus) EmailVerificationStatusHolder(org.sagebionetworks.bridge.models.apps.EmailVerificationStatusHolder) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Example 2 with EmailVerificationStatus

use of org.sagebionetworks.bridge.services.EmailVerificationStatus in project BridgeServer2 by Sage-Bionetworks.

the class AppController method getEmailStatus.

@GetMapping(path = { "/v1/apps/self/emailStatus", "/v3/studies/self/emailStatus" })
public EmailVerificationStatusHolder getEmailStatus() {
    UserSession session = getAuthenticatedSession(DEVELOPER);
    App app = appService.getApp(session.getAppId());
    EmailVerificationStatus status = emailVerificationService.getEmailStatus(app.getSupportEmail());
    return new EmailVerificationStatusHolder(status);
}
Also used : App(org.sagebionetworks.bridge.models.apps.App) UserSession(org.sagebionetworks.bridge.models.accounts.UserSession) EmailVerificationStatus(org.sagebionetworks.bridge.services.EmailVerificationStatus) EmailVerificationStatusHolder(org.sagebionetworks.bridge.models.apps.EmailVerificationStatusHolder) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

UserSession (org.sagebionetworks.bridge.models.accounts.UserSession)2 App (org.sagebionetworks.bridge.models.apps.App)2 EmailVerificationStatusHolder (org.sagebionetworks.bridge.models.apps.EmailVerificationStatusHolder)2 EmailVerificationStatus (org.sagebionetworks.bridge.services.EmailVerificationStatus)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1