From 9b750f60dfc6275d518d44ac84fe3c21e012b130 Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Thu, 19 Mar 2020 23:39:34 +0800 Subject: [PATCH] Remove route entry to reset password fixes #10712 The functions in CommonController are kept as a reference. Signed-off-by: Daniel Jiang --- src/core/controllers/controllers_test.go | 11 ----------- src/portal/src/app/sign-in/sign-in.component.html | 1 - src/portal/src/app/sign-in/sign-in.component.ts | 4 ---- src/server/route.go | 2 -- 4 files changed, 18 deletions(-) diff --git a/src/core/controllers/controllers_test.go b/src/core/controllers/controllers_test.go index 1bc397baa..f3f1f6555 100644 --- a/src/core/controllers/controllers_test.go +++ b/src/core/controllers/controllers_test.go @@ -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") } diff --git a/src/portal/src/app/sign-in/sign-in.component.html b/src/portal/src/app/sign-in/sign-in.component.html index 10134f794..381ea6807 100644 --- a/src/portal/src/app/sign-in/sign-in.component.html +++ b/src/portal/src/app/sign-in/sign-in.component.html @@ -27,7 +27,6 @@ - {{'SIGN_IN.FORGOT_PWD' | translate}}
{{ 'SIGN_IN.INVALID_MSG' | translate }} diff --git a/src/portal/src/app/sign-in/sign-in.component.ts b/src/portal/src/app/sign-in/sign-in.component.ts index 97d757872..9f6688190 100644 --- a/src/portal/src/app/sign-in/sign-in.component.ts +++ b/src/portal/src/app/sign-in/sign-in.component.ts @@ -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; diff --git a/src/server/route.go b/src/server/route.go index bcee366a1..de8caf5e5 100644 --- a/src/server/route.go +++ b/src/server/route.go @@ -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")