package Ġcom . d anny j ung . github api . data . repository Ċ Ċ import Ġcom . d anny j ung . github api . data . local . datasource . Auth Local DataSource Ċ import Ġcom . d anny j ung . github api . data . local . datasource . Star red Repo Local DataSource Ċ import Ġcom . d anny j ung . github api . data . mapper . Auth Mapper Ċ import Ġcom . d anny j ung . github api . data . remote . datasource . Auth Remote DataSource Ċ import Ġcom . d anny j ung . github api . domain . di . qual ifiers . Io Dispatcher Ċ import Ġcom . d anny j ung . github api . domain . model . AccessToken Ċ import Ġcom . d anny j ung . github api . domain . repository . Auth Repository Ċ import Ġkotlinx . coroutines . Coroutine Dispatcher Ċ import Ġkotlinx . coroutines . flow . Flow Ċ import Ġkotlinx . coroutines . with Context Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠAuth Repository Impl Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġ@ Io Dispatcher Ġprivate Ġval Ġcoroutine Dispatcher : ĠCor outine Dispatcher , ĊĠĠĠ Ġprivate Ġval Ġauth Local DataSource : ĠAuth Local DataSource , ĊĠĠĠ Ġprivate Ġval Ġauth Remote DataSource : ĠAuth Remote DataSource , ĊĠĠĠ Ġprivate Ġval Ġstar red Repo Local DataSource : ĠStar red Repo Local DataSource Ċ ) Ġ: ĠAuth Repository Ġ{ ĊĊĠĠĠ Ġoverride Ġval Ġstream : ĠFlow < String ?> ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġauth Local DataSource . stream ĊĊĠĠĠ Ġoverride Ġval ĠaccessToken : ĠString ? ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġauth Local DataSource . get AccessToken () ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġrequest AccessToken ( code : ĠString ): ĠAccess Token Ġ= ĊĠĠĠĠĠĠĠ Ġwith Context ( coroutine Dispatcher ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval ĠaccessToken Response Ġ= Ġauth Remote DataSource . request AccessToken ( code ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġauth Local DataSource . set AccessToken ( accessToken Response . accessToken ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠAuth Mapper . mapper To AccessToken ( accessToken Response ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġclear () Ġ= ĊĠĠĠĠĠĠĠ Ġwith Context ( coroutine Dispatcher ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġauth Local DataSource . clear () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstar red Repo Local DataSource . delete All () ĊĠĠĠĠĠĠĠ Ġ} Ċ Ċ } Ċ