Skip to content

Commit aad0b44

Browse files
committed
Set type="password" on all auth_token fields
Seen when migrating from other hosting platforms. 1. Prevents exposing the token to screen capture/cameras/eyeballs. 2. Prevents the browser from saving the value in its autocomplete dictionary, which often is not secure. Closes #22174 Signed-off-by: Dan Church <amphetamachine@gmail.com>
1 parent 27fcfae commit aad0b44

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

templates/repo/migrate/gitea.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<div class="inline field {{if .Err_Auth}}error{{end}}">
2222
<label for="auth_token">{{.locale.Tr "access_token"}}</label>
23-
<input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}>
23+
<input id="auth_token" name="auth_token" type="password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}>
2424
<a target="_blank" href="https://docs.gitea.io/en-us/api-usage">{{svg "octicon-question"}}</a>
2525
</div>
2626

templates/repo/migrate/github.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<div class="inline field {{if .Err_Auth}}error{{end}}">
2222
<label for="auth_token">{{.locale.Tr "access_token"}}</label>
23-
<input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
23+
<input id="auth_token" name="auth_token" type="password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
2424
<a target="_blank" href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">{{svg "octicon-question"}}</a>
2525
<span class="help">
2626
{{.locale.Tr "repo.migrate.github_token_desc"}}

templates/repo/migrate/gitlab.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<div class="inline field {{if .Err_Auth}}error{{end}}">
2222
<label for="auth_token">{{.locale.Tr "access_token"}}</label>
23-
<input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
23+
<input id="auth_token" name="auth_token" type="password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
2424
<a target="_blank" href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">{{svg "octicon-question"}}</a>
2525
</div>
2626

templates/repo/migrate/gogs.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<div class="inline field {{if .Err_Auth}}error{{end}}">
2222
<label for="auth_token">{{.locale.Tr "access_token"}}</label>
23-
<input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}>
23+
<input id="auth_token" name="auth_token" type="password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}>
2424
<!-- <a target="_blank" href="https://docs.gitea.io/en-us/api-usage">{{svg "octicon-question"}}</a> -->
2525
</div>
2626

0 commit comments

Comments
 (0)