1515import com .programming .streaming .entity .AuthUser ;
1616import com .programming .streaming .repository .AuthUserRepository ;
1717
18- import org .springframework .web .bind .annotation .CrossOrigin ;
1918import org .springframework .web .bind .annotation .GetMapping ;
2019import org .springframework .web .bind .annotation .PathVariable ;
2120
@@ -50,7 +49,6 @@ public String getEmail() {
5049 }
5150 }
5251
53- @ CrossOrigin (origins = "*" )
5452 @ PostMapping ("/send-verification-email" )
5553 public String sendVerificationEmail (@ RequestBody String emailJson ) {
5654 SimpleMailMessage message = new SimpleMailMessage ();
@@ -69,7 +67,6 @@ public String sendVerificationEmail(@RequestBody String emailJson) {
6967 }
7068 }
7169
72- @ CrossOrigin (origins = "*" )
7370 @ PostMapping ("/register" )
7471 public ResponseEntity registerUser (@ RequestBody AuthUser user ) {
7572 try {
@@ -88,12 +85,11 @@ public ResponseEntity registerUser(@RequestBody AuthUser user) {
8885 }
8986
9087 private byte [] getDefaultAvatar () throws IOException {
91- String defaultAvatarPath = "src/main/java/com/programming/streaming/ images/avatar.png" ; // Replace with the actual path to the default avatar image
88+ String defaultAvatarPath = "/app/ images/avatar.png" ; // Path inside the Docker container
9289 Path path = Paths .get (defaultAvatarPath );
9390 return Files .readAllBytes (path );
9491 }
9592
96- @ CrossOrigin (origins = "*" )
9793 @ PostMapping ("/login2" )
9894 public ResponseEntity loginUser (@ RequestBody AuthUser user ) {
9995 try {
@@ -109,7 +105,6 @@ public ResponseEntity loginUser(@RequestBody AuthUser user) {
109105 }
110106 }
111107
112- @ CrossOrigin (origins = "*" )
113108 @ PostMapping ("/logout" )
114109 public ResponseEntity logoutUser () {
115110 try {
@@ -137,7 +132,6 @@ public ResponseEntity listUserbyUsername(@RequestBody AuthUser user) {
137132 }
138133 }
139134
140- @ CrossOrigin (origins = "*" )
141135 @ GetMapping ("/listUserbyId/{id}" )
142136 public ResponseEntity listUserbyId (@ PathVariable ("id" ) String id ) {
143137 try {
@@ -147,7 +141,6 @@ public ResponseEntity listUserbyId(@PathVariable("id") String id) {
147141 }
148142 }
149143
150- @ CrossOrigin (origins = "*" )
151144 @ PutMapping ("/updateProfile/{id}" )
152145 public ResponseEntity updateProfile (@ PathVariable ("id" ) String id , @ RequestBody AuthUser user ) {
153146 try {
@@ -164,7 +157,6 @@ public ResponseEntity updateProfile(@PathVariable("id") String id, @RequestBody
164157 }
165158 }
166159
167- @ CrossOrigin (origins = "*" )
168160 @ PutMapping ("/changePassword/{id}" )
169161 public ResponseEntity changePassword (@ PathVariable ("id" ) String id ,
170162 @ RequestBody ChangePasswordRequest changePasswordRequest ) {
0 commit comments