1
0
Fork 0
forgejo/routers/api/v1/admin
wxiaoguang 5d77691d42
Improve template system and panic recovery (#24461)
Partially for #24457

Major changes:

1. The old `signedUserNameStringPointerKey` is quite hacky, use
`ctx.Data[SignedUser]` instead
2. Move duplicate code from `Contexter` to `CommonTemplateContextData`
3. Remove incorrect copying&pasting code `ctx.Data["Err_Password"] =
true` in API handlers
4. Use one unique `RenderPanicErrorPage` for panic error page rendering
5. Move `stripSlashesMiddleware` to be the first middleware
6. Install global panic recovery handler, it works for both `install`
and `web`
7. Make `500.tmpl` only depend minimal template functions/variables,
avoid triggering new panics

Screenshot:

<details>

![image](https://user-images.githubusercontent.com/2114189/235444895-cecbabb8-e7dc-4360-a31c-b982d11946a7.png)

</details>
2023-05-04 14:36:34 +08:00
..
adopt.go Fix unclear IsRepositoryExist logic (#24374) 2023-04-28 14:14:26 -04:00
cron.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
email.go add admin API email endpoints (#22792) 2023-03-14 03:54:40 -04:00
hooks.go Fix typo in API route (#24310) 2023-04-24 20:44:27 +02:00
org.go Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
repo.go Handle missing README in create repos API (#23387) 2023-03-13 16:55:30 -05:00
user.go Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00