- Notifications
You must be signed in to change notification settings - Fork278
Lost Password Feature#715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
FalkWolsky merged 15 commits intolowcoder-org:feat-password-resetfromirfan-ikhwa:lost-password-featureMar 5, 2024
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
15 commits Select commitHold shift + click to select a range
a2bd841
feature: Initial Implementation of `lost-password` api endpoint
irfan-ikhwaceabd3b
feature: Initial Implementation of Email Sending Feature with dummy D…
irfan-ikhwac4b18bd
feature: Initial Password reset flow implementation
irfan-ikhwa96081d3
feature: Added email template in OrganizationCommonSettings, Added pu…
irfan-ikhwad5c63ea
feature: Added emailTemplate in common-settings.
irfan-ikhwa0a213f4
Merge branch 'dev' into lost-password-feature
aq-ikhwa-tech65d9e2a
Misc fixes
aq-ikhwa-tech39ad3ac
Misc fixes
aq-ikhwa-tech72518dc
Update application.props
aq-ikhwa-techd384418
Update application.props to include smtp server auth
aq-ikhwa-tech810d669
Merge branch 'lowcoder-org:main' into lost-password-feature
aq-ikhwa-tech758f86f
Merge branch 'dev' into lost-password-feature
aq-ikhwa-tech0391d2a
feature: Added Env Variables for SMPT server
irfan-ikhwabc74e8a
feature: Rename SMTP Env variable to ADMIN
irfan-ikhwa30dcd9c
Merge branch 'dev' into lost-password-feature
FalkWolskyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletionsserver/api-service/lowcoder-domain/pom.xml
This file contains hidden or 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
2 changes: 1 addition & 1 deletion...ce/lowcoder-domain/src/main/java/org/lowcoder/domain/organization/model/Organization.java
This file contains hidden or 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
10 changes: 10 additions & 0 deletions...omain/src/main/java/org/lowcoder/domain/organization/service/OrganizationServiceImpl.java
This file contains hidden or 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
5 changes: 5 additions & 0 deletionsserver/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/user/model/User.java
This file contains hidden or 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
49 changes: 49 additions & 0 deletions...oder-domain/src/main/java/org/lowcoder/domain/user/service/EmailCommunicationService.java
This file contains hidden or 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,49 @@ | ||
package org.lowcoder.domain.user.service; | ||
import jakarta.mail.internet.MimeMessage; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.lowcoder.sdk.config.CommonConfig; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.mail.javamail.JavaMailSender; | ||
import org.springframework.mail.javamail.MimeMessageHelper; | ||
import org.springframework.stereotype.Service; | ||
@Service | ||
@Slf4j(topic = "EmailCommunicationService") | ||
public class EmailCommunicationService { | ||
@Autowired | ||
private JavaMailSender javaMailSender; | ||
@Autowired | ||
private CommonConfig config; | ||
public boolean sendPasswordResetEmail(String to, String token, String message) { | ||
try { | ||
String subject = "Reset Your Lost Password"; | ||
MimeMessage mimeMessage = javaMailSender.createMimeMessage(); | ||
MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage, true); | ||
mimeMessageHelper.setFrom(config.getLostPasswordEmailSender()); | ||
mimeMessageHelper.setTo(to); | ||
mimeMessageHelper.setSubject(subject); | ||
// Construct the message with the token link | ||
String resetLink = config.getLowcoderPublicUrl() + "/lost-password?token=" + token; | ||
String formattedMessage = String.format(message, to, resetLink); | ||
mimeMessageHelper.setText(formattedMessage, true); // Set HTML to true to allow links | ||
javaMailSender.send(mimeMessage); | ||
return true; | ||
} catch (Exception e) { | ||
log.error("Failed to send mail to: {}, Exception: ", to, e); | ||
return false; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions...i-service/lowcoder-domain/src/main/java/org/lowcoder/domain/user/service/UserService.java
This file contains hidden or 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
50 changes: 49 additions & 1 deletion...rvice/lowcoder-domain/src/main/java/org/lowcoder/domain/user/service/UserServiceImpl.java
This file contains hidden or 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
2 changes: 2 additions & 0 deletionsserver/api-service/lowcoder-sdk/src/main/java/org/lowcoder/sdk/config/CommonConfig.java
This file contains hidden or 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
3 changes: 3 additions & 0 deletionsserver/api-service/lowcoder-sdk/src/main/resources/locale_en.properties
This file contains hidden or 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
4 changes: 4 additions & 0 deletions...ice/lowcoder-server/src/main/java/org/lowcoder/api/framework/security/SecurityConfig.java
This file contains hidden or 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
8 changes: 8 additions & 0 deletions...service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/UserApiService.java
This file contains hidden or 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
20 changes: 20 additions & 0 deletions...service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/UserController.java
This file contains hidden or 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
12 changes: 12 additions & 0 deletions...-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/UserEndpoints.java
This file contains hidden or 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
16 changes: 16 additions & 0 deletionsserver/api-service/lowcoder-server/src/main/resources/application-lowcoder.yml
This file contains hidden or 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
7 changes: 7 additions & 0 deletionsserver/api-service/lowcoder-server/src/main/resources/selfhost/ce/application.yml
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.