标签: aws-amplify-vue

How do I disable the sign up link for the aws amplify vue authenticator?

I'm using the amplify-authenticator component from the aws-amplify-vue library to enable authentication for my app. I'm trying to figure out how to disable the "Create Account" link on the front end and I can't seem to find anything in the documentation or online. I've seen a few places where users disabled it by hiding it with css and a few places where users were able to disable it with the react library, but I haven't found anything specific for the …

javascript typescript aws-amplify aws-amplify-vue

9
推荐指数
2
解决办法
4237
查看次数

放大:即使在 API 网关和 Lambda 标头中启用了 CORS,也会出现 CORS 标头“Access-Control-Allow-Origin”丢失错误

我正在使用 Amplify,并将我的 API 网关代理到 Lambda。我已经启用了 CORS/{proxy+}并部署了 API。在我的 Lambda 函数中,我在我的平凡函数中设置了适当的标头:

import json


def handler(event, context):
    print("received event:")
    print(event)
    return {
        "statusCode": 200,
        "headers": {
            "Access-Control-Allow-Credentials": True,
            "Access-Control-Allow-Headers": "Content-Type",
            "Access-Control-Allow-Methods": "OPTIONS,POST,GET",
            "Access-Control-Allow-Origin": "*",
        },
        "body": json.dumps(event),
    }

Run Code Online (Sandbox Code Playgroud)

此 Lambda 函数位于通过 Cognito 进行身份验证的 API 网关资源之后。

当我使用 Amplify 调用我的 API 时:

let myInit = {
          headers: {
            Authorization: `Bearer ${(await Auth.currentSession())
              .getIdToken()
              .getJwtToken()}`
          }
        }; 

API.get("adminapi", "/admin", myInit) ...

Run Code Online (Sandbox Code Playgroud)

我的GET请求中缺少可怕的 CORS 标头“Access-Control-Allow-Origin” :

Cross-Origin Request Blocked: The Same Origin Policy …

cors amplifyjs aws-amplify aws-amplify-vue

6
推荐指数
2
解决办法
1万
查看次数

在 vite + vue3 + TS 项目中,AWS Amplify 解析组件失败

我很难让 AWS Amplify 与Vite.js 一起工作

// First I was getting this error:
Uncaught ReferenceError: global is not defined
Run Code Online (Sandbox Code Playgroud)

所以,我script在 index.html 的head部分添加了这个

<script>
  var global = global || window;
  var Buffer = Buffer || [];
  var process = process || {
    env: { DEBUG: undefined },
    version: []
  };
</script>
Run Code Online (Sandbox Code Playgroud)

现在,我收到此警告/错误

[Vue warn]: Failed to resolve component: amplify-sign-out 
[Vue warn]: Failed to resolve component: amplify-authenticator 
Run Code Online (Sandbox Code Playgroud)

您可以在此处查看完整日志: 在此处输入图片说明

javascript aws-amplify vuejs3 aws-amplify-vue vitejs

5
推荐指数
1
解决办法
637
查看次数