package Ġapp . xl ui . pw itter . config Ċ Ċ import Ġapp . xl ui . pw itter . annotation . CurrentUser Method Argument Resolver Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . web . method . support . Handler Method Argument Resolver Ċ import Ġorg . springframework . web . servlet . config . annotation . Cors Registry Ċ import Ġorg . springframework . web . servlet . config . annotation . Web Mvc Configurer Ċ Ċ @ Configuration Ċ class ĠWeb Mvc Configuration Ġ@ Autowired Ġconstructor ( ĊĠĠĠ Ġval ĠcurrentUser Resolver : ĠCurrent User Method Argument Resolver , Ċ ) Ġ: ĠWeb Mvc Configurer Ġ{ ĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* Ġannotation Ġresolver ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġoverride Ġfun Ġadd Argument Resolvers ( resolvers : ĠMutable List < Handler Method Argument Resolver >) Ġ{ ĊĠĠĠĠĠĠĠ Ġresolver s . add ( currentUser Resolver ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠCross - Origin Ġsupport ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġoverride Ġfun Ġadd Cors Mappings ( registry : ĠC ors Registry ) Ġ{ ĊĠĠĠĠĠĠĠ Ġregistry . add Mapping (" /** ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. allowed Orig ins ("* ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. allowed Methods (" OPTIONS ", Ġ" GET ", Ġ" POST ", Ġ" PUT ", Ġ" PATCH ", Ġ" DELETE ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. allowed Headers (" Authorization ", Ġ" Content - Type ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. max Age ( 6 0 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. allow Credentials ( false ); ĊĠĠĠ Ġ} Ċ }