Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Implement Backend Functionality for Email Sending #87

Open
1 task done
shreya5653 opened this issue Oct 25, 2024 · 27 comments
Open
1 task done

[FEATURE] Implement Backend Functionality for Email Sending #87

shreya5653 opened this issue Oct 25, 2024 · 27 comments
Assignees
Labels
enhancement New feature or request gssoc GirlScript Summer Of Code gssoc-ext hacktoberfest hacktoberfest-accepted level3 GirlScript Summer Of Code - 35 points status: ready for dev You can asked for this issue to be assigned (if not already assigned)

Comments

@shreya5653
Copy link
Contributor

Is this feature already requested?

  • I have checked "open" and "closed" issues, and this is not a duplicate.

Problem or Missing Functionality

The current system cannot send emails to subscribers, which blocks newsletters and notifications from reaching users. It also lacks unsubscribe options and proper email authentication. This feature will add email sending capabilities with reliable delivery and unsubscribe support.

Feature Description

This feature will enable the backend to send emails using an SMTP server (like Gmail or SendGrid) for newsletters and notifications. It will include authentication (SPF, DKIM, DMARC) to avoid spam issues and add unsubscribe options for users.

Screenshots

No response

Would you like to work on this feature?

Yes

Implementation Plan

The feature will be implemented by integrating an SMTP service to enable email sending. We will develop a service for composing and sending emails, add an unsubscribe option for users, and set up a retry mechanism for failed attempts. After testing the functionality, the feature will be deployed to the production environment, with ongoing monitoring for delivery reliability.

@shreya5653 shreya5653 added the status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) label Oct 25, 2024
@shreya5653
Copy link
Contributor Author

@ajaynegi45 @Guhapriya01 I was studying the email-sending functionality, but I got delayed in raising the issue due to my exams. Now, I’d like to work on this issue. Please assign it to me.

@ajaynegi45
Copy link
Owner

The feature will be implemented by integrating an SMTP service to ena

Hi @shreya5653,
Thank you for expressing your interest in working on this issue. I'm delighted to inform you that I have assigned this issue to you. Your willingness to contribute to our project is much appreciated.

Use gmail to send emails. If I didn't reply within 24hr then ping me on LinkedIn.

Before making any contributions, please read the Readme.md file carefully to better understand the project's goals and purpose. This will give you clarity on our mission. Also, make sure to review the Contributing.md file, which contains important guidelines to make the contribution process smoother, especially for newcomers.

Feel free to start working, and if you have any questions or need assistance during the process, please don't hesitate to reach out.

@ajaynegi45 ajaynegi45 added enhancement New feature or request hacktoberfest-accepted hacktoberfest status: ready for dev You can asked for this issue to be assigned (if not already assigned) gssoc GirlScript Summer Of Code gssoc-ext level3 GirlScript Summer Of Code - 35 points and removed status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) labels Oct 26, 2024
@shreya5653
Copy link
Contributor Author

The feature will be implemented by integrating an SMTP service to ena

Hi @shreya5653, Thank you for expressing your interest in working on this issue. I'm delighted to inform you that I have assigned this issue to you. Your willingness to contribute to our project is much appreciated.

Use gmail to send emails. If I didn't reply within 24hr then ping me on LinkedIn.

Before making any contributions, please read the Readme.md file carefully to better understand the project's goals and purpose. This will give you clarity on our mission. Also, make sure to review the Contributing.md file, which contains important guidelines to make the contribution process smoother, especially for newcomers.

Feel free to start working, and if you have any questions or need assistance during the process, please don't hesitate to reach out.

Sure! Thank you so much

@shreya5653
Copy link
Contributor Author

shreya5653 commented Oct 27, 2024

@ajaynegi45 @Guhapriya01 I've been trying to run my project since yesterday, but I'm facing issues even after confirming that all dependency configurations are correct. After syncing the fork, I'm encountering errors in various files, such as missing beans in borrowing. Please advise if others are experiencing similar issues and what steps I can take to resolve this. I want to test my changes effectively.

@ajaynegi45
Copy link
Owner

I think you haven't add required field in resources folder.

@shreya5653
Copy link
Contributor Author

shreya5653 commented Oct 28, 2024

I think you haven't add required field in resources folder.

@ajaynegi45
I added all the required fields in the resources folder. After resolving all the errors and adding Oauth configurations after logging in with my email its redirecting to same login page. Can you please tell me why this is so? I checked my redirecting url as well.

@shreya5653
Copy link
Contributor Author

@ajaynegi45 While testing the recent changes, I temporarily disabled authentication for the relevant endpoints to ensure everything else was functioning correctly. This allowed me to validate that the logic was correct and that all expected flows were working as intended. I’ve attached the relevant screenshots in my PR for your reference.

@ajaynegi45
Copy link
Owner

ajaynegi45 commented Oct 28, 2024

equired fields in the resources

https://www.linkedin.com/in/rishabh-singh-rawat-408762289/ He added the this feature. Ask your issue with him

@rishabhrawat05 can you resolve this issue

@shreya5653
Copy link
Contributor Author

equired fields in the resources

https://www.linkedin.com/in/rishabh-singh-rawat-408762289/ He added the this feature. Ask your issue with him

@rishabhrawat05 can you resolve this issue

@ajaynegi45 Thank you so much for your help so far. I will ask my issue to @rishabhrawat05. I temporarily bypassed the issue to test my changes, and everything is working correctly. It would be great if you could review my PR #89 so I can wrap this up and move on to a new issue.

@rishabhrawat05
Copy link
Contributor

@ajaynegi45 While testing the recent changes, I temporarily disabled authentication for the relevant endpoints to ensure everything else was functioning correctly. This allowed me to validate that the logic was correct and that all expected flows were working as intended. I’ve attached the relevant screenshots in my PR for your reference.

Hey! Can you please share some screenshots of the error you are receiving while starting the application and also share screenshot of your application.properties file and application.production file.
I will try to fix the issue as fast as possible

@Guhapriya01
Copy link
Collaborator

Guhapriya01 commented Oct 29, 2024

@ajaynegi45 I added all the required fields in the resources folder. After resolving all the errors and adding Oauth configurations after logging in with my email its redirecting to same login page. Can you please tell me why this is so? I checked my redirecting url as well.

Hi @shreya5653,

I saw your message about the redirect issue after logging in. Just to clarify, are you experiencing the redirect problem with the OAuth login or the basic login? Knowing this will help us assist you better. Also, if you could share any relevant screenshots that @rishabhrawat05 requested, that would be really helpful.

@shreya5653
Copy link
Contributor Author

@ajaynegi45 I added all the required fields in the resources folder. After resolving all the errors and adding Oauth configurations after logging in with my email its redirecting to same login page. Can you please tell me why this is so? I checked my redirecting url as well.

Hi @shreya5653,

I saw your message about the redirect issue after logging in. Just to clarify, are you experiencing the redirect problem with the OAuth login or the basic login? Knowing this will help us assist you better. Also, if you could share any relevant screenshots that @rishabhrawat05 requested, that would be really helpful

@Guhapriya01 @rishabhrawat05 I am experiencing the redirecting issue when I try to log in using 0Auth and bad credentials using basic login. Here are the screenshots

Screenshot (134)
Screenshot (135)
Screenshot (137)

@rishabhrawat05
Copy link
Contributor

rishabhrawat05 commented Oct 29, 2024

@ajaynegi45 I added all the required fields in the resources folder. After resolving all the errors and adding Oauth configurations after logging in with my email its redirecting to same login page. Can you please tell me why this is so? I checked my redirecting url as well.

Hi @shreya5653,
I saw your message about the redirect issue after logging in. Just to clarify, are you experiencing the redirect problem with the OAuth login or the basic login? Knowing this will help us assist you better. Also, if you could share any relevant screenshots that @rishabhrawat05 requested, that would be really helpful

@Guhapriya01 @rishabhrawat05 I am experiencing the redirecting issue when I try to log in using 0Auth and bad credentials using basic login. Here are the screenshots

Screenshot (134) Screenshot (135) Screenshot (137)

Is there any error showing up in terminal and also can you use this jwt.secretKey=eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTczMDEwNTk4MSwiaWF0IjoxNzMwMTA1OTg
Instead of jwt.secretKey=shreya123

@shreya5653
Copy link
Contributor Author

@ajaynegi45 I added all the required fields in the resources folder. After resolving all the errors and adding Oauth configurations after logging in with my email its redirecting to same login page. Can you please tell me why this is so? I checked my redirecting url as well.

Hi @shreya5653,
I saw your message about the redirect issue after logging in. Just to clarify, are you experiencing the redirect problem with the OAuth login or the basic login? Knowing this will help us assist you better. Also, if you could share any relevant screenshots that @rishabhrawat05 requested, that would be really helpful

@Guhapriya01 @rishabhrawat05 I am experiencing the redirecting issue when I try to log in using 0Auth and bad credentials using basic login. Here are the screenshots
Screenshot (134) Screenshot (135) Screenshot (137)

Is there any error showing up in terminal

No not error as such only logs

@rishabhrawat05
Copy link
Contributor

@ajaynegi45 I added all the required fields in the resources folder. After resolving all the errors and adding Oauth configurations after logging in with my email its redirecting to same login page. Can you please tell me why this is so? I checked my redirecting url as well.

Hi @shreya5653,
I saw your message about the redirect issue after logging in. Just to clarify, are you experiencing the redirect problem with the OAuth login or the basic login? Knowing this will help us assist you better. Also, if you could share any relevant screenshots that @rishabhrawat05 requested, that would be really helpful

@Guhapriya01 @rishabhrawat05 I am experiencing the redirecting issue when I try to log in using 0Auth and bad credentials using basic login. Here are the screenshots
Screenshot (134) Screenshot (135) Screenshot (137)

Is there any error showing up in terminal

No not error as such only logs

Ok try this jwt.secretKey=eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTczMDEwNTk4MSwiaWF0IjoxNzMwMTA1OTg
Instead of jwt.secretKey=shreya123

@shreya5653
Copy link
Contributor Author

@rishabhrawat05 Still the same issue .
In the terminal :
2024-10-29T13:27:50.796+05:30 INFO 18204 --- [libraryman-api] [nio-8080-exec-7] Spring Security Debugger :


Request received for GET '/login':

org.apache.catalina.connector.RequestFacade@6f3b1af5

servletPath:/login
pathInfo:null
headers:
host: localhost:8080
connection: keep-alive
sec-ch-ua-platform: "Windows"
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
sec-ch-ua: "Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99"
sec-ch-ua-mobile: ?0
accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8
sec-fetch-site: same-origin
sec-fetch-mode: no-cors
sec-fetch-dest: image
referer: http://localhost:8080/login?error
accept-encoding: gzip, deflate, br, zstd
accept-language: en-US,en;q=0.9,en-IN;q=0.8
cookie: JSESSIONID=4E256A68568F153EE977230001DEBE94

Security filter chain: [
DisableEncodeUrlFilter
WebAsyncManagerIntegrationFilter
SecurityContextHolderFilter
HeaderWriterFilter
CorsFilter
LogoutFilter
OAuth2AuthorizationRequestRedirectFilter
OAuth2LoginAuthenticationFilter
JwtAuthenticationFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
DefaultLogoutPageGeneratingFilter
BasicAuthenticationFilter
RequestCacheAwareFilter
SecurityContextHolderAwareRequestFilter
AnonymousAuthenticationFilter
SessionManagementFilter
ExceptionTranslationFilter
AuthorizationFilter
]


This is what I get

@rishabhrawat05
Copy link
Contributor

rishabhrawat05 commented Oct 29, 2024

@rishabhrawat05 Still the same issue . In the terminal : 2024-10-29T13:27:50.796+05:30 INFO 18204 --- [libraryman-api] [nio-8080-exec-7] Spring Security Debugger :

Request received for GET '/login':

org.apache.catalina.connector.RequestFacade@6f3b1af5

servletPath:/login pathInfo:null headers: host: localhost:8080 connection: keep-alive sec-ch-ua-platform: "Windows" user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0 sec-ch-ua: "Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99" sec-ch-ua-mobile: ?0 accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8 sec-fetch-site: same-origin sec-fetch-mode: no-cors sec-fetch-dest: image referer: http://localhost:8080/login?error accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9,en-IN;q=0.8 cookie: JSESSIONID=4E256A68568F153EE977230001DEBE94

Security filter chain: [ DisableEncodeUrlFilter WebAsyncManagerIntegrationFilter SecurityContextHolderFilter HeaderWriterFilter CorsFilter LogoutFilter OAuth2AuthorizationRequestRedirectFilter OAuth2LoginAuthenticationFilter JwtAuthenticationFilter UsernamePasswordAuthenticationFilter DefaultLoginPageGeneratingFilter DefaultLogoutPageGeneratingFilter BasicAuthenticationFilter RequestCacheAwareFilter SecurityContextHolderAwareRequestFilter AnonymousAuthenticationFilter SessionManagementFilter ExceptionTranslationFilter AuthorizationFilter ]

This is what I get

Did you test this on postman,
Like registering and then login

@shreya5653
Copy link
Contributor Author

@rishabhrawat05 Still the same issue . In the terminal : 2024-10-29T13:27:50.796+05:30 INFO 18204 --- [libraryman-api] [nio-8080-exec-7] Spring Security Debugger :
Request received for GET '/login':
org.apache.catalina.connector.RequestFacade@6f3b1af5
servletPath:/login pathInfo:null headers: host: localhost:8080 connection: keep-alive sec-ch-ua-platform: "Windows" user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0 sec-ch-ua: "Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99" sec-ch-ua-mobile: ?0 accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8 sec-fetch-site: same-origin sec-fetch-mode: no-cors sec-fetch-dest: image referer: http://localhost:8080/login?error accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9,en-IN;q=0.8 cookie: JSESSIONID=4E256A68568F153EE977230001DEBE94
Security filter chain: [ DisableEncodeUrlFilter WebAsyncManagerIntegrationFilter SecurityContextHolderFilter HeaderWriterFilter CorsFilter LogoutFilter OAuth2AuthorizationRequestRedirectFilter OAuth2LoginAuthenticationFilter JwtAuthenticationFilter UsernamePasswordAuthenticationFilter DefaultLoginPageGeneratingFilter DefaultLogoutPageGeneratingFilter BasicAuthenticationFilter RequestCacheAwareFilter SecurityContextHolderAwareRequestFilter AnonymousAuthenticationFilter SessionManagementFilter ExceptionTranslationFilter AuthorizationFilter ]
This is what I get

Did you test this on postman, Like registering and then login

For testing any endpoints 401 unauthorized error . I tested my endpoints by temporarily disabling the authentication for those specific endpoints

@rishabhrawat05
Copy link
Contributor

@rishabhrawat05 Still the same issue . In the terminal : 2024-10-29T13:27:50.796+05:30 INFO 18204 --- [libraryman-api] [nio-8080-exec-7] Spring Security Debugger :
Request received for GET '/login':
org.apache.catalina.connector.RequestFacade@6f3b1af5
servletPath:/login pathInfo:null headers: host: localhost:8080 connection: keep-alive sec-ch-ua-platform: "Windows" user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0 sec-ch-ua: "Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99" sec-ch-ua-mobile: ?0 accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8 sec-fetch-site: same-origin sec-fetch-mode: no-cors sec-fetch-dest: image referer: http://localhost:8080/login?error accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9,en-IN;q=0.8 cookie: JSESSIONID=4E256A68568F153EE977230001DEBE94
Security filter chain: [ DisableEncodeUrlFilter WebAsyncManagerIntegrationFilter SecurityContextHolderFilter HeaderWriterFilter CorsFilter LogoutFilter OAuth2AuthorizationRequestRedirectFilter OAuth2LoginAuthenticationFilter JwtAuthenticationFilter UsernamePasswordAuthenticationFilter DefaultLoginPageGeneratingFilter DefaultLogoutPageGeneratingFilter BasicAuthenticationFilter RequestCacheAwareFilter SecurityContextHolderAwareRequestFilter AnonymousAuthenticationFilter SessionManagementFilter ExceptionTranslationFilter AuthorizationFilter ]
This is what I get

Did you test this on postman, Like registering and then login

For testing any endpoints 401 unauthorized error . I tested my endpoints by temporarily disabling the authentication for those specific endpoints

Register also showing 401 unauthorised??

@shreya5653
Copy link
Contributor Author

@rishabhrawat05 Still the same issue . In the terminal : 2024-10-29T13:27:50.796+05:30 INFO 18204 --- [libraryman-api] [nio-8080-exec-7] Spring Security Debugger :
Request received for GET '/login':
org.apache.catalina.connector.RequestFacade@6f3b1af5
servletPath:/login pathInfo:null headers: host: localhost:8080 connection: keep-alive sec-ch-ua-platform: "Windows" user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0 sec-ch-ua: "Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99" sec-ch-ua-mobile: ?0 accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8 sec-fetch-site: same-origin sec-fetch-mode: no-cors sec-fetch-dest: image referer: http://localhost:8080/login?error accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9,en-IN;q=0.8 cookie: JSESSIONID=4E256A68568F153EE977230001DEBE94
Security filter chain: [ DisableEncodeUrlFilter WebAsyncManagerIntegrationFilter SecurityContextHolderFilter HeaderWriterFilter CorsFilter LogoutFilter OAuth2AuthorizationRequestRedirectFilter OAuth2LoginAuthenticationFilter JwtAuthenticationFilter UsernamePasswordAuthenticationFilter DefaultLoginPageGeneratingFilter DefaultLogoutPageGeneratingFilter BasicAuthenticationFilter RequestCacheAwareFilter SecurityContextHolderAwareRequestFilter AnonymousAuthenticationFilter SessionManagementFilter ExceptionTranslationFilter AuthorizationFilter ]
This is what I get

Did you test this on postman, Like registering and then login

For testing any endpoints 401 unauthorized error . I tested my endpoints by temporarily disabling the authentication for those specific endpoints

Register also showing 401 unauthorised??

Yes

@rishabhrawat05
Copy link
Contributor

@rishabhrawat05 Still the same issue . In the terminal : 2024-10-29T13:27:50.796+05:30 INFO 18204 --- [libraryman-api] [nio-8080-exec-7] Spring Security Debugger :
Request received for GET '/login':
org.apache.catalina.connector.RequestFacade@6f3b1af5
servletPath:/login pathInfo:null headers: host: localhost:8080 connection: keep-alive sec-ch-ua-platform: "Windows" user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0 sec-ch-ua: "Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99" sec-ch-ua-mobile: ?0 accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8 sec-fetch-site: same-origin sec-fetch-mode: no-cors sec-fetch-dest: image referer: http://localhost:8080/login?error accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9,en-IN;q=0.8 cookie: JSESSIONID=4E256A68568F153EE977230001DEBE94
Security filter chain: [ DisableEncodeUrlFilter WebAsyncManagerIntegrationFilter SecurityContextHolderFilter HeaderWriterFilter CorsFilter LogoutFilter OAuth2AuthorizationRequestRedirectFilter OAuth2LoginAuthenticationFilter JwtAuthenticationFilter UsernamePasswordAuthenticationFilter DefaultLoginPageGeneratingFilter DefaultLogoutPageGeneratingFilter BasicAuthenticationFilter RequestCacheAwareFilter SecurityContextHolderAwareRequestFilter AnonymousAuthenticationFilter SessionManagementFilter ExceptionTranslationFilter AuthorizationFilter ]
This is what I get

Did you test this on postman, Like registering and then login

For testing any endpoints 401 unauthorized error . I tested my endpoints by temporarily disabling the authentication for those specific endpoints

Register also showing 401 unauthorised??

Yes

Okay, I will review the code and error and then get back to you as fast as possible

@shreya5653
Copy link
Contributor Author

shreya5653 commented Oct 29, 2024

@rishabhrawat05 Still the same issue . In the terminal : 2024-10-29T13:27:50.796+05:30 INFO 18204 --- [libraryman-api] [nio-8080-exec-7] Spring Security Debugger :
Request received for GET '/login':
org.apache.catalina.connector.RequestFacade@6f3b1af5
servletPath:/login pathInfo:null headers: host: localhost:8080 connection: keep-alive sec-ch-ua-platform: "Windows" user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0 sec-ch-ua: "Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99" sec-ch-ua-mobile: ?0 accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8 sec-fetch-site: same-origin sec-fetch-mode: no-cors sec-fetch-dest: image referer: http://localhost:8080/login?error accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9,en-IN;q=0.8 cookie: JSESSIONID=4E256A68568F153EE977230001DEBE94
Security filter chain: [ DisableEncodeUrlFilter WebAsyncManagerIntegrationFilter SecurityContextHolderFilter HeaderWriterFilter CorsFilter LogoutFilter OAuth2AuthorizationRequestRedirectFilter OAuth2LoginAuthenticationFilter JwtAuthenticationFilter UsernamePasswordAuthenticationFilter DefaultLoginPageGeneratingFilter DefaultLogoutPageGeneratingFilter BasicAuthenticationFilter RequestCacheAwareFilter SecurityContextHolderAwareRequestFilter AnonymousAuthenticationFilter SessionManagementFilter ExceptionTranslationFilter AuthorizationFilter ]
This is what I get

Did you test this on postman, Like registering and then login

For testing any endpoints 401 unauthorized error . I tested my endpoints by temporarily disabling the authentication for those specific endpoints

Register also showing 401 unauthorised??

Yes

Okay, I will review the code and error and then get back to you as fast as possible

Okay Thank you so much @rishabhrawat05 . But I request @Guhapriya01 @ajaynegi45 to review my PR or at least let me know is my PR #89 under review coz this won't cause any conflicts with existing code.

@Guhapriya01
Copy link
Collaborator

@shreya5653, sure! We’ll review it and let you know soon if any changes are needed.

Regarding the error, since you’re receiving a 401 Unauthorized for all endpoints, it’s likely that the Bearer token isn’t being included correctly in the Authorization header, or it might be invalid. Please double-check to ensure that the token is included properly.

@shreya5653
Copy link
Contributor Author

@shreya5653, sure! We’ll review it and let you know soon if any changes are needed.

Regarding the error, since you’re receiving a 401 Unauthorized for all endpoints, it’s likely that the Bearer token isn’t being included correctly in the Authorization header, or it might be invalid. Please double-check to ensure that the token is included properly.

Okay I will check it. Thank you so much!

@rishabhrawat05
Copy link
Contributor

rishabhrawat05 commented Oct 29, 2024

Hey! @shreya5653
The redirect problem can only be fixed while creating the front end, as we cannot redirect to a different API just by logging in. We need a token to access different endpoints. Also,
I have reviewed your code thoroughly, and it needs some changes.
Here are the changes

  1. Don't create extra EmailService and mail config files. The email sender/email service is already present. Here's how you can use it
    image

  2. While sending the email you have to pass notification as a parameter of email service, passing null will raise a proxy error. Here's how you can implement
    image

  3. Keep application.properties file as it is only change ${ENV:dev} to ${ENV:production} and use jwt.secretKey=eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTczMDEwNTk4MSwiaWF0IjoxNzMwMTA1OTg
    After that, your application.properties file should look like this
    image

  4. In the notification package -> NotificationType add two new values SUBSCRIBED and UNSUBSCRIBED. Here's how it will look
    image

  5. Also, Increase the length of NotificationType in Notifications class by applying length=20 or it will raise error

Hope these changes will help project improvement,
If you have any other issues please reach out I will help as fast as possible.

@shreya5653
Copy link
Contributor Author

Hey! @shreya5653 The redirect problem can only be fixed while creating the front end, as we cannot redirect to a different API just by logging in. We need a token to access different endpoints. Also, I have reviewed your code thoroughly, and it needs some changes. Here are the changes

  1. Don't create extra EmailService and mail config files. The email sender/email service is already present. Here's how you can use it
    image
  2. While sending the email you have to pass notification as a parameter of email service, passing null will raise a proxy error. Here's how you can implement
    image
  3. Keep application.properties file as it is only change ${ENV:dev} to ${ENV:production} and use jwt.secretKey=eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTczMDEwNTk4MSwiaWF0IjoxNzMwMTA1OTg
    After that, your application.properties file should look like this
    image
  4. In the notification package -> NotificationType add two new values SUBSCRIBED and UNSUBSCRIBED. Here's how it will look
    image
  5. Also, Increase the length of NotificationType in Notifications class by applying length=20 or it will raise error

Hope these changes will help project improvement, If you have any other issues please reach out I will help as fast as possible.

@rishabhrawat05
Thank you so much for your guidance! I really appreciate your help. While making the changes, I kept your suggestions in mind and did my best to implement them. I believe I’ve made some progress and achieved what we wanted, but I wasn’t able to follow your suggestions exactly as you mentioned, as some of them were a bit difficult for me to grasp.

@rishabhrawat05
Copy link
Contributor

Hey! @shreya5653 The redirect problem can only be fixed while creating the front end, as we cannot redirect to a different API just by logging in. We need a token to access different endpoints. Also, I have reviewed your code thoroughly, and it needs some changes. Here are the changes

  1. Don't create extra EmailService and mail config files. The email sender/email service is already present. Here's how you can use it
    image
  2. While sending the email you have to pass notification as a parameter of email service, passing null will raise a proxy error. Here's how you can implement
    image
  3. Keep application.properties file as it is only change ${ENV:dev} to ${ENV:production} and use jwt.secretKey=eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTczMDEwNTk4MSwiaWF0IjoxNzMwMTA1OTg
    After that, your application.properties file should look like this
    image
  4. In the notification package -> NotificationType add two new values SUBSCRIBED and UNSUBSCRIBED. Here's how it will look
    image
  5. Also, Increase the length of NotificationType in Notifications class by applying length=20 or it will raise error

Hope these changes will help project improvement, If you have any other issues please reach out I will help as fast as possible.

@rishabhrawat05 Thank you so much for your guidance! I really appreciate your help. While making the changes, I kept your suggestions in mind and did my best to implement them. I believe I’ve made some progress and achieved what we wanted, but I wasn’t able to follow your suggestions exactly as you mentioned, as some of them were a bit difficult for me to grasp.

Happy to hear that ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc GirlScript Summer Of Code gssoc-ext hacktoberfest hacktoberfest-accepted level3 GirlScript Summer Of Code - 35 points status: ready for dev You can asked for this issue to be assigned (if not already assigned)
Projects
None yet
Development

No branches or pull requests

4 participants