Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin authored Aug 8, 2024
2 parents d9d858a + 19e7137 commit 5663637
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/backend/src/modules/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class Auth {
async #generateEmailVerificationCode(userId: string, email: string): Promise<string> {
const tx = getCurrentTransaction()
await tx.deleteFrom("undb_email_verification_code").where("user_id", "=", userId).execute()
const code = generateRandomString(6, alphabet("0-9"))
const code = env.UNDB_MOCK_MAIL_CODE || generateRandomString(6, alphabet("0-9"))
await tx
.insertInto("undb_email_verification_code")
.values({
Expand Down
24 changes: 13 additions & 11 deletions apps/frontend/src/routes/(auth)/signup/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,19 @@
Already have an account?
<a href="/login" class="underline"> Sign in </a>
</div>
<Separator class="my-6" />
<div class="space-y-2">
<Button href="/login/github" variant="secondary" class="w-full">
<img class="mr-2 h-4 w-4" src={Github} alt="github" />
Login with Github
</Button>
<Button href="/login/google" variant="secondary" class="w-full">
<img class="mr-2 h-4 w-4" src={Google} alt="google" />
Login with Google
</Button>
</div>
{#if !invitationId}
<Separator class="my-6" />
<div class="space-y-2">
<Button href="/login/github" variant="secondary" class="w-full">
<img class="mr-2 h-4 w-4" src={Github} alt="github" />
Login with Github
</Button>
<Button href="/login/google" variant="secondary" class="w-full">
<img class="mr-2 h-4 w-4" src={Google} alt="google" />
Login with Google
</Button>
</div>
{/if}
</Card.Content>
</Card.Root>
</form>
Expand Down
1 change: 1 addition & 0 deletions packages/env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const emailEnv = createEnv({
UNDB_MAIL_HOST: z.string().optional(),
UNDB_MAIL_PORT: z.string().optional(),
UNDB_MAIL_DEFAULT_FROM: z.string().optional(),
UNDB_MOCK_MAIL_CODE: z.string().optional(),
UNDB_MAIL_SECURE: z
.string()
.optional()
Expand Down

0 comments on commit 5663637

Please sign in to comment.