Search in sources :

Example 1 with AppEmailType

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

the class AppController method resendVerifyEmail.

/**
 * Resends the verification email for the current app's email.
 */
@PostMapping(path = { "/v1/apps/self/emails/resendVerify", "/v3/studies/self/emails/resendVerify" })
public StatusMessage resendVerifyEmail(@RequestParam(required = false) String type) {
    UserSession session = getAuthenticatedSession(DEVELOPER);
    AppEmailType parsedType = parseEmailType(type);
    appService.sendVerifyEmail(session.getAppId(), parsedType);
    return RESEND_EMAIL_MSG;
}
Also used : UserSession(org.sagebionetworks.bridge.models.accounts.UserSession) AppEmailType(org.sagebionetworks.bridge.services.AppEmailType) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Example 2 with AppEmailType

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

the class AppController method verifyEmail.

/**
 * Verifies the emails for the app. Since this comes in from an email with a token, you don't need to be
 * authenticated. The token itself knows what app this is for.
 */
@PostMapping(path = { "/v1/apps/{appId}/emails/verify", "/v3/studies/{appId}/emails/verify" })
public StatusMessage verifyEmail(@PathVariable String appId, @RequestParam(required = false) String token, @RequestParam(required = false) String type) {
    AppEmailType parsedType = parseEmailType(type);
    appService.verifyEmail(appId, token, parsedType);
    return CONSENT_EMAIL_VERIFIED_MSG;
}
Also used : AppEmailType(org.sagebionetworks.bridge.services.AppEmailType) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

AppEmailType (org.sagebionetworks.bridge.services.AppEmailType)2 PostMapping (org.springframework.web.bind.annotation.PostMapping)2 UserSession (org.sagebionetworks.bridge.models.accounts.UserSession)1