Index: sources/app/src/main/java/parkup/configs/CustomAuthenticationFilter.java
===================================================================
--- sources/app/src/main/java/parkup/configs/CustomAuthenticationFilter.java	(revision e8b107664cbbdab4c97fd805edc407b38456fe88)
+++ sources/app/src/main/java/parkup/configs/CustomAuthenticationFilter.java	(revision bc20307a9fafa202ad52835e03582454a2a4242d)
@@ -80,5 +80,5 @@
             }
             case "Guest":{
-                Guest user = (Guest) authentication.getAuthorities();
+                Guest user = (Guest) authentication.getPrincipal();
                 email = user.getEmail();
                 fullName="GuestUser";
Index: sources/app/src/main/java/parkup/configs/webConfigs/WebSecurityConfig.java
===================================================================
--- sources/app/src/main/java/parkup/configs/webConfigs/WebSecurityConfig.java	(revision e8b107664cbbdab4c97fd805edc407b38456fe88)
+++ sources/app/src/main/java/parkup/configs/webConfigs/WebSecurityConfig.java	(revision bc20307a9fafa202ad52835e03582454a2a4242d)
@@ -42,5 +42,5 @@
             auth.userDetailsService(workerService).passwordEncoder(bCryptPasswordEncoder);
             auth.userDetailsService(administratorService).passwordEncoder(bCryptPasswordEncoder);
-            auth.userDetailsService(guestService);
+            auth.userDetailsService(guestService).passwordEncoder(bCryptPasswordEncoder);
         }
 
Index: sources/app/src/main/java/parkup/controllers/GuestController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/GuestController.java	(revision e8b107664cbbdab4c97fd805edc407b38456fe88)
+++ sources/app/src/main/java/parkup/controllers/GuestController.java	(revision bc20307a9fafa202ad52835e03582454a2a4242d)
@@ -38,6 +38,7 @@
 
     @PostMapping({"/guest"})
-    public void addGuest(@RequestBody Guest guest) {
-        this.guestService.addGuest(guest);
+    public Guest addGuest(@RequestBody Guest guest) {
+        Guest guestToReturn = this.guestService.addGuest(guest);
+        return guestToReturn;
     }
 
Index: sources/app/src/main/java/parkup/entities/Guest.java
===================================================================
--- sources/app/src/main/java/parkup/entities/Guest.java	(revision e8b107664cbbdab4c97fd805edc407b38456fe88)
+++ sources/app/src/main/java/parkup/entities/Guest.java	(revision bc20307a9fafa202ad52835e03582454a2a4242d)
@@ -29,5 +29,5 @@
     private int guestId;
 
-    @OneToOne
+    @OneToOne(cascade = {CascadeType.ALL})
     @JoinColumn(name = "tablickaId", nullable = false)
     private Plate plate;
@@ -39,5 +39,5 @@
     private String mobile;
 
-    @Column(name = "password")
+    @Column(name="password")
     private String password;
 
@@ -49,12 +49,14 @@
 
 
-    public Guest() {this.role=UserRole.ROLE_USER;}
-
-    public Guest(int guestId, Plate plate,String password, String email, String mobile) {
-        this.guestId = guestId;
-        this.plate = plate;
-        this.email = email;
+    public Guest() {
+        this.role = UserRole.ROLE_USER;
+        this.session = null;
+    }
+    public Guest(Plate plate, String email,String mobile,String password,ParkingSession session){
+        this.plate=plate;
+        this.email=email;
+        this.mobile=mobile;
         this.password=password;
-        this.mobile = mobile;
+        this.session=session;
         this.role=UserRole.ROLE_USER;
     }
@@ -64,4 +66,5 @@
         this.email = email;
         this.mobile = mobile;
+        this.password = "";
         this.role=UserRole.ROLE_USER;
     }
@@ -135,5 +138,5 @@
     @Override
     public String getPassword() {
-        return null;
+        return this.password;
     }
 
@@ -145,20 +148,20 @@
     @Override
     public boolean isAccountNonExpired() {
-        return false;
+        return true;
     }
 
     @Override
     public boolean isAccountNonLocked() {
-        return false;
+        return true;
     }
 
     @Override
     public boolean isCredentialsNonExpired() {
-        return false;
+        return true;
     }
 
     @Override
     public boolean isEnabled() {
-        return false;
+        return true;
     }
 }
Index: sources/app/src/main/java/parkup/entities/RegisteredUser.java
===================================================================
--- sources/app/src/main/java/parkup/entities/RegisteredUser.java	(revision e8b107664cbbdab4c97fd805edc407b38456fe88)
+++ sources/app/src/main/java/parkup/entities/RegisteredUser.java	(revision bc20307a9fafa202ad52835e03582454a2a4242d)
@@ -63,5 +63,5 @@
         this.plates = new ArrayList<Plate>();
         this.role = UserRole.ROLE_REG_USER;
-        session=null;
+        this.session=null;
     }
 
Index: sources/app/src/main/java/parkup/services/GuestService.java
===================================================================
--- sources/app/src/main/java/parkup/services/GuestService.java	(revision e8b107664cbbdab4c97fd805edc407b38456fe88)
+++ sources/app/src/main/java/parkup/services/GuestService.java	(revision bc20307a9fafa202ad52835e03582454a2a4242d)
@@ -38,6 +38,8 @@
         } else {
             double random = Math.random()*10000;
+            guest.setPassword(passwordEncoder.encode(Integer.toString((int)random)));
+            this.guestRepository.save(guest);
             guest.setPassword(Integer.toString((int)random));
-           return  this.guestRepository.save(guest);
+           return  guest;
         }
     }
