我正在使用最新的AWS Amplify的身份验证组件.它可以成功登录,但在登录后,我需要将路由发送到另一个我无法实现的url,它在登录后保持相同的url.但我需要设置一个自定义url,如果用户成功登录,它会自动重定向.
注意:我没有使用aws-amplify-angular
个软件包,我使用的是这些软件包,
"@aws-amplify/ui-angular": "^2.4.4",
"aws-amplify": "^4.3.21",
我也判断了这个import {AuthenticatorService} from '@aws-amplify/ui-angular';
服务,但在这里我没有发现任何可观察类型的响应,我想这就是为什么我没有在用户成功登录后立即得到任何事件或东西.我需要在成功登录后立即发送.所以我需要一个活动,这样我才能做到.
我的main.ts
:
import { Amplify } from 'aws-amplify'
import awsmobile from './aws-exports'
Amplify.configure(awsmobile)
auth.component.html
:[ts
中没有代码]
<amplify-authenticator [signUpAttributes]="['email']"></amplify-authenticator>
&;路由是这样设置的,
const routes: Routes = [
{
path: 'home',
component: HomeComponent,
canActivate: [AuthGuard]
},
{
path: 'auth',
component: AuthComponent
},
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
}
];
使用这个软件包,我没有得到任何好的解决方案.请帮助解决这个问题,否则我的配置中会遗漏什么.