Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support user email verification mechanism
Signed-off-by: guqing <1484563614@qq.com>
- Loading branch information
Showing
16 changed files
with
769 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
application/src/main/java/run/halo/app/core/extension/service/EmailVerificationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package run.halo.app.core.extension.service; | ||
|
||
import reactor.core.publisher.Mono; | ||
import run.halo.app.infra.exception.EmailVerificationFailed; | ||
|
||
/** | ||
* Email verification service to handle email verification. | ||
* | ||
* @author guqing | ||
* @since 2.11.0 | ||
*/ | ||
public interface EmailVerificationService { | ||
|
||
/** | ||
* Send verification code by given username. | ||
* | ||
* @param username username to obtain email | ||
*/ | ||
Mono<Void> sendVerificationCode(String username); | ||
|
||
/** | ||
* Verify email by given username and code. | ||
* | ||
* @param username username to obtain email | ||
* @param code code to verify | ||
* @throws EmailVerificationFailed if send failed | ||
*/ | ||
Mono<Void> verify(String username, String code); | ||
} |
Oops, something went wrong.