package Ġdelta . code character . server . auth Ċ Ċ import Ġdelta . code character . core . Auth Api Ċ import Ġdelta . code character . d tos . Auth Status Response Dto Ċ import Ġdelta . code character . d tos . Forgot Password Request Dto Ċ import Ġdelta . code character . d tos . Password Login Request Dto Ċ import Ġdelta . code character . d tos . Password Login Response Dto Ċ import Ġdelta . code character . d tos . Reset Password Request Dto Ċ import Ġdelta . code character . server . user . User Entity Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . security . access . annotation . Sec ured Ċ import Ġorg . springframework . security . core . context . SecurityContext Holder Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ Ċ @ RestController Ċ class ĠAuth Controller (@ Autowired Ġprivate Ġval Ġauth Service : ĠAuth Service ) Ġ: ĠAuth Api Ġ{ ĊĊĠĠĠ Ġ@ Sec ured ( value Ġ= Ġ[" ROLE _ AN ONY MO US "]) ĊĠĠĠ Ġoverride Ġfun Ġpassword Login ( ĊĠĠĠĠĠĠĠ Ġ@ RequestBody Ġpassword Login Request Dto : ĠPassword Login Request Dto ĊĠĠĠ Ġ): ĠResponseEntity < Password Login Response Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ( auth Service . password Login ( password Login Request Dto )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Sec ured ( value Ġ= Ġ[" ROLE _ AN ONY MO US "]) ĊĠĠĠ Ġoverride Ġfun Ġforgot Password ( ĊĠĠĠĠĠĠĠ Ġforgot Password Request Dto : ĠF orgot Password Request Dto ĊĠĠĠ Ġ): ĠResponseEntity < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġauth Service . forgot Password ( forgot Password Request Dto ) ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . status ( HttpStatus . ACCEPT ED ). body ( Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Sec ured ( value Ġ= Ġ[" ROLE _ AN ONY MO US "]) ĊĠĠĠ Ġoverride Ġfun Ġreset Password ( ĊĠĠĠĠĠĠĠ Ġreset Password Request Dto : ĠReset Password Request Dto ĊĠĠĠ Ġ): ĠResponseEntity < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġauth Service . reset Password ( reset Password Request Dto ) ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . status ( HttpStatus . ACCEPT ED ). body ( Unit ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Sec ured ( value Ġ= Ġ[" ROLE _ USER ", Ġ" ROLE _ USER _ IN COMPLETE _ PROFILE "]) ĊĠĠĠ Ġoverride Ġfun Ġget Auth Status (): ĠResponseEntity < Auth Status Response Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuser Ġ= ĠSecurity Context Holder . getContext (). authentication . principal Ġas ĠUser Entity ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ( auth Service . get Auth Status ( user )) ĊĠĠĠ Ġ} Ċ } Ċ