mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-01 17:38:33 +00:00
Show user OpenID URIs in their profile (#1314)
This commit is contained in:
parent
e1586898b2
commit
9182a35f18
11 changed files with 180 additions and 0 deletions
|
@ -45,6 +45,12 @@ func SettingsOpenIDPost(ctx *context.Context, form auth.AddOpenIDForm) {
|
|||
ctx.Data["PageIsSettingsOpenID"] = true
|
||||
|
||||
if ctx.HasError() {
|
||||
openid, err := models.GetUserOpenIDs(ctx.User.ID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetUserOpenIDs", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["OpenIDs"] = openid
|
||||
ctx.HTML(200, tplSettingsOpenID)
|
||||
return
|
||||
}
|
||||
|
@ -140,3 +146,13 @@ func DeleteOpenID(ctx *context.Context) {
|
|||
})
|
||||
}
|
||||
|
||||
// ToggleOpenIDVisibility response for toggle visibility of user's openid
|
||||
func ToggleOpenIDVisibility(ctx *context.Context) {
|
||||
if err := models.ToggleUserOpenIDVisibility(ctx.QueryInt64("id")); err != nil {
|
||||
ctx.Handle(500, "ToggleUserOpenIDVisibility", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Redirect(setting.AppSubURL + "/user/settings/openid")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue