У меня есть материал углового приложения. Первая страница - это страница входа, которая при успешном входе заменяется домашней страницей. В случае с сафари я вижу, что пароль пользователя добавляется в URL после входа в систему. Я не ожидаю, что это произойдет, и в Chrome это не происходит.
Страница входа выглядит так:
<form (ngSubmit)="doLogin()">
<div><input matInput placeholder=" User ID" name="userId" [(ngModel)]="userId" ></div>
<div><input matInput type="password" name="password" placeholder=" Password" [(ngModel)]="password"></div>
<div><button mat-raised-button (click)="doLogin()">Sign In</button></div>
</form>
login.ts
userId:string
password:string
doLogin(){
this.errorMessage = ''
if(this.userId == undefined || this.userId == ''){
this.errorMessage = 'Authentication Failed'
return
}
var user:UserModel = this.dataStore.findUser(this.userId.trim().toLowerCase())
if(user == undefined || (user.password != this.password)){
this.errorMessage = 'Authentication Failed'
return
}
this.core.currentUser = user.userId
this.router.navigate(['homepage'])
}
app.routing.ts
const appRoutes: Routes = [
{
path: '',
component: LoginPageComponent
},
{
path: 'homepage',
component: DynamicHomeComponent
}
];
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
При входе в систему URL становится ниже в случае сафари:
https://myurl/homepage?userid=xxx&password=yyy