mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-16 23:35:20 +01:00
Remove route entry to reset password
fixes #10712 The functions in CommonController are kept as a reference. Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
parent
2859cd8b69
commit
9b750f60df
@ -45,9 +45,7 @@ func init() {
|
||||
|
||||
beego.Router("/c/login", &CommonController{}, "post:Login")
|
||||
beego.Router("/c/log_out", &CommonController{}, "get:LogOut")
|
||||
beego.Router("/c/reset", &CommonController{}, "post:ResetPassword")
|
||||
beego.Router("/c/userExists", &CommonController{}, "post:UserExists")
|
||||
beego.Router("/c/sendEmail", &CommonController{}, "get:SendResetEmail")
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
@ -120,18 +118,9 @@ func TestAll(t *testing.T) {
|
||||
assert.Equal(int(200), w.Code, "'/c/log_out' httpStatusCode should be 200")
|
||||
assert.Equal(true, strings.Contains(fmt.Sprintf("%s", w.Body), ""), "http respond should be empty")
|
||||
|
||||
r, _ = http.NewRequest("POST", "/c/reset", nil)
|
||||
w = httptest.NewRecorder()
|
||||
handler.ServeHTTP(w, r)
|
||||
assert.Equal(http.StatusForbidden, w.Code, "'/c/reset' httpStatusCode should be 403")
|
||||
|
||||
r, _ = http.NewRequest("POST", "/c/userExists", nil)
|
||||
w = httptest.NewRecorder()
|
||||
handler.ServeHTTP(w, r)
|
||||
assert.Equal(http.StatusForbidden, w.Code, "'/c/userExists' httpStatusCode should be 403")
|
||||
|
||||
r, _ = http.NewRequest("GET", "/c/sendEmail", nil)
|
||||
w = httptest.NewRecorder()
|
||||
handler.ServeHTTP(w, r)
|
||||
assert.Equal(int(400), w.Code, "'/c/sendEmail' httpStatusCode should be 400")
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
<input clrCheckbox type="checkbox" id="rememberme" #rememberMeBox (click)="clickRememberMe($event)" [checked]="rememberMe">
|
||||
<label class="reset-label" for="rememberme">{{ 'SIGN_IN.REMEMBER' | translate }}</label>
|
||||
</clr-checkbox-wrapper>
|
||||
<a *ngIf="showForgetPwd" href="javascript:void(0)" class="forgot-password-link" (click)="forgotPassword()">{{'SIGN_IN.FORGOT_PWD' | translate}}</a>
|
||||
</div>
|
||||
<div [class.visibility-hidden]="!isError" class="error active">
|
||||
{{ 'SIGN_IN.INVALID_MSG' | translate }}
|
||||
|
@ -144,10 +144,6 @@ export class SignInComponent implements AfterViewChecked, OnInit {
|
||||
public get isOidcLoginMode(): boolean {
|
||||
return this.appConfig.auth_mode === CONFIG_AUTH_MODE.OIDC_AUTH;
|
||||
}
|
||||
public get showForgetPwd(): boolean {
|
||||
return this.appConfig.auth_mode !== CONFIG_AUTH_MODE.LDAP_AUTH && this.appConfig.auth_mode !== CONFIG_AUTH_MODE.UAA_AUTH
|
||||
&& this.appConfig.auth_mode !== CONFIG_AUTH_MODE.OIDC_AUTH && this.appConfig.auth_mode !== CONFIG_AUTH_MODE.HTTP_AUTH;
|
||||
}
|
||||
clickRememberMe($event: any): void {
|
||||
if ($event && $event.target) {
|
||||
this.rememberMe = $event.target.checked;
|
||||
|
@ -30,9 +30,7 @@ func registerRoutes() {
|
||||
// Controller API:
|
||||
beego.Router("/c/login", &controllers.CommonController{}, "post:Login")
|
||||
beego.Router("/c/log_out", &controllers.CommonController{}, "get:LogOut")
|
||||
beego.Router("/c/reset", &controllers.CommonController{}, "post:ResetPassword")
|
||||
beego.Router("/c/userExists", &controllers.CommonController{}, "post:UserExists")
|
||||
beego.Router("/c/sendEmail", &controllers.CommonController{}, "get:SendResetEmail")
|
||||
beego.Router(common.OIDCLoginPath, &controllers.OIDCController{}, "get:RedirectLogin")
|
||||
beego.Router("/c/oidc/onboard", &controllers.OIDCController{}, "post:Onboard")
|
||||
beego.Router(common.OIDCCallbackPath, &controllers.OIDCController{}, "get:Callback")
|
||||
|
Loading…
Reference in New Issue
Block a user