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:
Daniel Jiang 2020-03-19 23:39:34 +08:00
parent 2859cd8b69
commit 9b750f60df
4 changed files with 0 additions and 18 deletions

View File

@ -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")
}

View File

@ -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 }}

View File

@ -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;

View File

@ -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")