我正在尝试根据以下教程使用 Vue.js 构建 AWS Amplify 身份验证页面:https://dev.to/dabit3/how-to-build-production-ready-vue-authentication-23mk 。我正在配置profile.vue
组件将与经过身份验证的用户关联的用户信息传递给模板。在本教程中,一个名为 Auth.currentAuthenticatedUser
的方法返回 user
包含有关登录用户的元数据的对象。通过附加 .username
来访问此元数据至name
在模板中。以下是上述教程中该组件的示例,其中包含 Auth.currentAuthenticatedUser
方法:
<template>
<h1>Welcome, {{user.username}}</h1>
</template>
<script>
import { Auth } from 'aws-amplify'
export default {
name: 'Profile',
data() {
return {
user: {}
}
},
beforeCreate() {
Auth.currentAuthenticatedUser()
.then(user => {
this.user = user
})
.catch(() => console.log('not signed in...'))
}
}
</script>
我的问题是:创建用户后,哪个 AWS 服务实际存储该用户数据?有没有类似Amplify或Cognito的仪表盘,用来以集合的形式管理用户信息?
最佳答案
由于您正在使用 Amplify 和 auth class aws-amplify
npm 包提供的我相信答案是您已经在使用 Cognito。您应该已经能够在 Cognito 中查看您的用户了。
关于javascript - 如何管理使用 AWS Amplify Authentication 创建的用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58979328/