improve personal data export
parent
8184806d84
commit
150ebc39e8
|
@ -426,7 +426,9 @@ final class Account(
|
|||
|
||||
def data =
|
||||
Auth { implicit ctx => me =>
|
||||
val userId = get("user").ifTrue(isGranted(_.Impersonate)) | me.id
|
||||
val userId = get("user")
|
||||
.map(lila.user.User.normalize)
|
||||
.filter(id => me.id == id || isGranted(_.Impersonate)) | me.id
|
||||
env.user.repo byId userId flatMap {
|
||||
_ ?? { user =>
|
||||
env.api.personalDataExport(user) map { raw =>
|
||||
|
|
|
@ -16,7 +16,7 @@ object bits {
|
|||
h1("My personal data"),
|
||||
div(cls := "personal-data__header")(
|
||||
p("Here is all personal information Lichess has about ", userLink(u)),
|
||||
a(cls := "button", href := s"${routes.Account.data()}?text=1")(trans.downloadRaw())
|
||||
a(cls := "button", href := s"${routes.Account.data()}?user=${u.id}&text=1")(trans.downloadRaw())
|
||||
),
|
||||
st.section(
|
||||
pre(cls := "raw-text")(raw)
|
||||
|
|
Loading…
Reference in New Issue