Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6828af9

Browse files
Thomasrludomikula
Thomasr
authored andcommitted
#1322: Added API: /email/bind
1 parentf23e901 commit6828af9

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/AuthenticationController.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
packageorg.lowcoder.api.authentication;
22

3-
importjava.util.List;
4-
importjava.util.Map;
5-
3+
importlombok.RequiredArgsConstructor;
64
importorg.lowcoder.api.authentication.dto.APIKeyRequest;
75
importorg.lowcoder.api.authentication.dto.AuthConfigRequest;
86
importorg.lowcoder.api.authentication.service.AuthenticationApiService;
@@ -14,19 +12,18 @@
1412
importorg.lowcoder.api.util.BusinessEventPublisher;
1513
importorg.lowcoder.domain.authentication.FindAuthConfig;
1614
importorg.lowcoder.domain.user.model.APIKey;
15+
importorg.lowcoder.domain.user.service.UserService;
1716
importorg.lowcoder.sdk.auth.AbstractAuthConfig;
18-
importorg.lowcoder.sdk.auth.Oauth2GenericAuthConfig;
1917
importorg.lowcoder.sdk.util.CookieHelper;
20-
importorg.springframework.http.ResponseEntity;
2118
importorg.springframework.web.bind.annotation.PathVariable;
2219
importorg.springframework.web.bind.annotation.RequestBody;
2320
importorg.springframework.web.bind.annotation.RequestParam;
2421
importorg.springframework.web.bind.annotation.RestController;
2522
importorg.springframework.web.server.ServerWebExchange;
26-
27-
importlombok.RequiredArgsConstructor;
2823
importreactor.core.publisher.Mono;
2924

25+
importjava.util.List;
26+
3027
@RequiredArgsConstructor
3128
@RestController
3229
publicclassAuthenticationControllerimplementsAuthenticationEndpoints
@@ -36,6 +33,7 @@ public class AuthenticationController implements AuthenticationEndpoints
3633
privatefinalSessionUserServicesessionUserService;
3734
privatefinalCookieHelpercookieHelper;
3835
privatefinalBusinessEventPublisherbusinessEventPublisher;
36+
privatefinalUserServiceuserService;
3937

4038
/**
4139
* login by email or phone with password; or register by email for now.
@@ -130,4 +128,10 @@ public Mono<ResponseView<List<APIKey>>> getAllAPIKeys() {
130128
.collectList()
131129
.map(ResponseView::success);
132130
}
131+
132+
@Override
133+
publicMono<ResponseView<?>>bindEmail(@RequestParamStringemail) {
134+
returnsessionUserService.getVisitor().flatMap(user ->userService.bindEmail(user,email))
135+
.map(ResponseView::success);
136+
}
133137
}

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/AuthenticationEndpoints.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ public Mono<ResponseView<Boolean>> linkAccountWithThirdParty(
143143
@GetMapping("/api-keys")
144144
publicMono<ResponseView<List<APIKey>>>getAllAPIKeys();
145145

146+
@Operation(
147+
tags =TAG_AUTHENTICATION,
148+
operationId ="bindEmail",
149+
summary ="Bind current User to email",
150+
description ="Bind current user to email"
151+
)
152+
@PostMapping("/email/bind")
153+
publicMono<ResponseView<?>>bindEmail(@RequestParamStringemail);
154+
146155
/**
147156
* @param loginId phone number or email for now.
148157
* @param register register or login

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp