Skip to content

Commit 8ff558c

Browse files
authored
Merge pull request #33 from TP-RENTPLACE/feature/(TP-77)-add-auth-module
Feature/(tp 77) add auth module
2 parents 878c33b + d7e42f4 commit 8ff558c

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

.github/workflows/backend-ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ jobs:
101101
script: |
102102
cd Deploy
103103
docker compose down
104-
echo 'MAIL_USERNAME=${MAIL_USERNAME}' >> .env
105-
echo 'MAIL_USERNAME=${MAIL_PASSWORD}' >> .env
104+
echo '\nMAIL_USERNAME=${{ secrets.MAIL_USERNAME }}' >> .env
105+
echo 'MAIL_PASSWORD=${{ secrets.MAIL_PASSWORD }}' >> .env
106106
docker rm $(docker ps -a -q)
107107
docker pull ${{ secrets.DOCKERHUB_BACKEND_IMAGE_NAME }}
108108
docker compose up -d --build

rentplace/src/main/java/kattsyn/dev/rentplace/configs/CorsConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ public class CorsConfig implements WebMvcConfigurer {
1010
@Override
1111
public void addCorsMappings(CorsRegistry registry) {
1212
registry.addMapping("/**")
13-
.allowedOrigins("*")
13+
.allowedOrigins("*", "localhost")
1414
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH")
1515
.allowedHeaders("*")
16-
.allowCredentials(false)
16+
.allowCredentials(true)
1717
.maxAge(3600);
1818
}
1919
}

rentplace/src/main/java/kattsyn/dev/rentplace/configs/SecurityConfig.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ public class SecurityConfig {
3636
@PostConstruct
3737
public void init() {
3838
PUBLIC_URLS = new String[]{
39-
"/" + apiPath + "/auth/register",
40-
"/" + apiPath + "/auth/code-request",
41-
"/" + apiPath + "/auth/login",
39+
"/" + apiPath + "/auth/**",
4240
"/swagger-ui/**",
4341
"/v3/api-docs/**"
4442
};

rentplace/src/main/java/kattsyn/dev/rentplace/services/impl/VerificationCodeServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public void generateAndSendCode(String email) {
4646

4747
@Override
4848
public String generateCode() {
49-
return String.format("%06d", new Random().nextInt(999999));
49+
return String.format("%05d", new Random().nextInt(99999));
5050
}
5151
}

0 commit comments

Comments
 (0)