File tree Expand file tree Collapse file tree 4 files changed +23
-8
lines changed
infra/modules/compute/lambda Expand file tree Collapse file tree 4 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ resource "aws_iam_role_policy_attachment" "dynamodb_role_attach" {
2424 policy_arn = " arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess_v2"
2525}
2626
27+ resource "aws_iam_role_policy_attachment" "ses_role_attach" {
28+ role = aws_iam_role. lambda_execute_role . name
29+ policy_arn = " arn:aws:iam::aws:policy/AmazonSESFullAccess"
30+ }
2731
2832data "aws_iam_policy_document" "cloudwatch_readwrite" {
2933 statement {
Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ import {User} from "../../stores/user.js";
77
88const KB_API_URL = import .meta.env.VITE_KB_API_URL
99
10+ let props = defineProps ({
11+ user: {
12+ type: User,
13+ required: true
14+ }
15+ })
16+
1017let todo = false ;
1118let emailInput = defineModel ();
1219let disableTextField = ref (false );
@@ -19,13 +26,12 @@ function sendEmail() {
1926 if (! isValidEmail ()) return
2027
2128 disableTextField .value = true
22- const user = User .loadCache ();
23- axios .post (` ${ KB_API_URL } /verify/email/send` ,{
29+ axios .post (` ${ KB_API_URL } /users/${ props .user .userId } /links/send-email` ,{
2430 email: emailInput .value
2531 },
2632 {
2733 headers: {
28- ' Authorization' : ' Discord ' + user .token .accessToken
34+ ' Authorization' : ' Discord ' + props . user .token .accessToken
2935 }
3036 }
3137 ).then (
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ import {ref} from "vue";
77import {onClickOutside } from " @vueuse/core" ;
88import {User } from " ../../stores/user.js" ;
99
10- const userRef = ref (User .loadCache ())
10+ const props = defineProps ({
11+ user: {
12+ type: User,
13+ required: true
14+ }
15+ })
1116
1217const modalActiveRef = ref (false )
1318const modalBox = ref (null )
@@ -19,14 +24,14 @@ onClickOutside(modalBox, () => {
1924 </script >
2025
2126<template >
22- <button class =" btn btn-xs btn-primary" :class =" !userRef ? 'btn-disabled' : ''"
27+ <button class =" btn btn-xs btn-primary" :class =" !$props.user ? 'btn-disabled' : ''"
2328 @click =" modalActiveRef = true" >
2429 <fa :icon =" ['fas', 'plus']" />
2530 add
2631 </button >
2732
2833 <Teleport to =" #modal" >
29- <div class =" modal" :class =" modalActiveRef ? 'modal-open' : ''" v-if =" userRef " >
34+ <div class =" modal" :class =" modalActiveRef ? 'modal-open' : ''" v-if =" $props.user " >
3035 <div class =" modal-box w-96 bg-base-300" ref =" modalBox" >
3136 <h3 class =" text-lg font-bold" >Link Account</h3 >
3237 <div class =" modal-action" >
@@ -35,7 +40,7 @@ onClickOutside(modalBox, () => {
3540 <br >
3641 <GoogleAuthButton />
3742 <div class =" divider" >Other</div >
38- <EmailAuthText />
43+ <EmailAuthText :user = " $props.user " />
3944 </div >
4045
4146 </div >
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ onMounted(async () => {
4343 <div class =" flex flex-col w-full" >
4444 <div class =" flex flex-row justify-between mb-2.5" >
4545 <h3 class =" text-lg font-bold self-center" >Linked Accounts</h3 >
46- <LinkAccountButton />
46+ <LinkAccountButton :user = " user " />
4747 </div >
4848 <LinkedAccountsTable />
4949 </div >
You can’t perform that action at this time.
0 commit comments