Skip to content

Commit

Permalink
feat: signup improvements (#838)
Browse files Browse the repository at this point in the history
Signed-off-by: hxtree <[email protected]>
  • Loading branch information
hxtree authored Feb 22, 2024
1 parent b17130f commit 75fa87c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/call-cdk-synth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
PROJECT_ROOT: ${{ github.workspace }}

- name: install cdk
run: npm install --global aws-cdk@2.94.0
run: npm install --global aws-cdk@2.129.0
env:
PROJECT_ROOT: ${{ github.workspace }}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt update \
# https://rushjs.io/
&& npm install --global @microsoft/[email protected] \
# https://docs.aws.amazon.com/cdk/v2/guide/work-with-cdk-typescript.html
&& npm install --global aws-cdk@2.94.0 \
&& npm install --global aws-cdk@2.129.0 \
# install typescript globally (perhaps this could be moved to local)
&& npm install --global typedocs \
# https://github.com/org-formation/org-formation-cli
Expand Down
2 changes: 0 additions & 2 deletions clients/admin-client/src/components/DiceAnalyzer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,12 @@ export const DiceAnalyzer = (props: DiceAnalyzerProps) => {
value={iterations}
onChange={(e: any) => setIterations(Number(e.target.value))}
variant="standard"
// sx={{ width: '5ch', ml: 1 }}
/>
<TextField
label="Luck"
value={luck}
onChange={(e: any) => setLuck(e.target.value)}
variant="standard"
// sx={{ width: '5ch', ml: 1 }}
/>
</Box>
</Stack>
Expand Down
1 change: 0 additions & 1 deletion clients/admin-client/src/pages/home.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function HomePage() {
No-frills, just a straightforward way to look at the data. Raise a <Link href='https://github.com/hxtree/cats-cradle/pulls'>pull request</Link> to suggest changes.
</p>
<Button href="/archetypes" color="secondary">Try It <FontAwesomeIcon icon={faArrowRight}/></Button>

</Paper>
</main>
</>
Expand Down
3 changes: 2 additions & 1 deletion platform/constructs/src/nestjs/nestjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { IRole } from 'aws-cdk-lib/aws-iam';
import { EnvironmentType } from './environment.type';

export interface NestJsProps {
functionName?: string;
projectRoot: string;
// apiId: string;
region: string;
stageName: string;
environment?: EnvironmentType;
Expand Down Expand Up @@ -70,6 +70,7 @@ export class NestJs extends Construct {
};

this.nodeJsFunction = new lambda.Function(this, 'NodeJsLambda', {
// functionName: `${awsAccountId}-${props.stageName}-${props.functionName}-function`,
runtime: lambda.Runtime.NODEJS_18_X,
code: lambda.Code.fromAsset(path.join(props.projectRoot, 'dist')),
handler: 'index.handler',
Expand Down
21 changes: 15 additions & 6 deletions services/user-service/src/modules/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
VERSION_NEUTRAL,
Res,
NotFoundException,
BadRequestException,
} from '@nestjs/common';
import { CognitoService } from './cognito.service';
import { AuthService } from './auth.service';
Expand Down Expand Up @@ -71,12 +72,20 @@ export class AuthController {

@Post('sign-up')
async signUp(@Body() body: SignUpDto) {
const { email, password } = body;
await this.cognitoService.signUp(email, password);
return {
message:
'Sign-up successful. Please check your email for verification instructions.',
};
try {
const { email, password } = body;
await this.cognitoService.signUp(email, password);
return {
message:
'Sign-up successful. Please check your email for verification instructions.',
};
} catch (err) {
const error = err as Error;
throw new BadRequestException('Failed to sign up', {
cause: error,
description: error.message,
});
}
}

@Post('confirm-sign-up')
Expand Down

0 comments on commit 75fa87c

Please sign in to comment.