mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-30 22:11:07 +00:00 
			
		
		
		
	Mirror fix on add ssh key
This commit is contained in:
		
					parent
					
						
							
								fb839ca0fb
							
						
					
				
			
			
				commit
				
					
						452ccff81c
					
				
			
		
					 4 changed files with 12 additions and 4 deletions
				
			
		|  | @ -177,9 +177,13 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) { | |||
| 		cleanContent := strings.Replace(form.Content, "\n", "", -1) | ||||
| 
 | ||||
| 		if ok, err := models.CheckPublicKeyString(cleanContent); !ok { | ||||
| 			ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error())) | ||||
| 			ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh") | ||||
| 			return | ||||
| 			if err == models.ErrKeyUnableVerify { | ||||
| 				ctx.Flash.Info(ctx.Tr("form.unable_verify_ssh_key")) | ||||
| 			} else { | ||||
| 				ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error())) | ||||
| 				ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh") | ||||
| 				return | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		k := &models.PublicKey{ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue