Skip to content

Conversation

@charansr
Copy link
Collaborator

No description provided.

@charansr charansr self-assigned this Oct 22, 2024
@vercel
Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
liborate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 7:52am
liborate-alpha ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 7:52am
zoom-companion-shaomei-test ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 7:52am
zoom-companion-test ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 7:52am

@charansr
Copy link
Collaborator Author

The build failed at ./app/api/auth/[...nextauth]/route.ts:23:13 but the code in that file is exactly the same as in main. Was the Github build check changed?

@Shaomei Shaomei requested review from Shaomei and blickly October 25, 2024 00:06
@Shaomei
Copy link
Collaborator

Shaomei commented Oct 25, 2024

@blickly, can you take a look at why the build is failing now? The error logs show a type error but not sure how it was introduced.

[00:03:40.437] Running build in Washington, D.C., USA (East) – iad1
[00:03:40.529] Cloning github.com/aimpowered/LibOrate (Branch: 56-password-recovery, Commit: 9c70be9)
[00:03:40.853] Cloning completed: 323ms
[00:03:50.185] Restored build cache from previous deployment (3SswhHqiBzpyXWc7UuYvigyhXZf7)
[00:03:50.263] Running "vercel build"
[00:03:51.430] Vercel CLI 37.12.0
[00:03:52.016] Installing dependencies...
[00:03:56.715] npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
[00:03:56.838] npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
[00:03:58.484] npm warn deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported
[00:04:02.284] npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
[00:04:15.185] 
[00:04:15.185] added 368 packages, removed 125 packages, and changed 354 packages in 23s
[00:04:15.185] 
[00:04:15.185] 203 packages are looking for funding
[00:04:15.186]   run `npm fund` for details
[00:04:15.218] Detected Next.js version: 14.2.16
[00:04:15.233] Running "npm run build"
[00:04:15.415] 
[00:04:15.415] > next-test-zoom-app@0.1.0 build
[00:04:15.415] > next build
[00:04:15.415] 
[00:04:16.280]   ▲ Next.js 14.2.16
[00:04:16.281]   - Experiments (use with caution):
[00:04:16.281]     · missingSuspenseWithCSRBailout
[00:04:16.281] 
[00:04:16.365]    Creating an optimized production build ...
[00:04:39.145]  ✓ Compiled successfully
[00:04:39.145]    Linting and checking validity of types ...
[00:04:47.493] Failed to compile.
[00:04:47.493] 
[00:04:47.493] ./app/api/auth/[...nextauth]/route.ts:23:13
[00:04:47.493] Type error: Type '(credentials: Record<never, string> | undefined, req: Pick<RequestInternal, "method" | "body" | "headers" | "query">) => Promise<{ email: string; role: "user" | "admin"; id: unknown; }>' is not assignable to type '(credentials: Record<never, string> | undefined, req: Pick<RequestInternal, "method" | "body" | "headers" | "query">) => Awaitable<User | null>'.
[00:04:47.493]   Type 'Promise<{ email: string; role: "user" | "admin"; id: unknown; }>' is not assignable to type 'Awaitable<User | null>'.
[00:04:47.493]     Type 'Promise<{ email: string; role: "user" | "admin"; id: unknown; }>' is not assignable to type 'PromiseLike<User | null>'.
[00:04:47.493]       Types of property 'then' are incompatible.
[00:04:47.493]         Type '<TResult1 = { email: string; role: "user" | "admin"; id: unknown; }, TResult2 = never>(onfulfilled?: ((value: { email: string; role: "user" | "admin"; id: unknown; }) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => ...' is not assignable to type '<TResult1 = User | null, TResult2 = never>(onfulfilled?: ((value: User | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => PromiseLike<...>'.
[00:04:47.493]           Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
[00:04:47.494]             Types of parameters 'value' and 'value' are incompatible.
[00:04:47.494]               Type '{ email: string; role: "user" | "admin"; id: unknown; }' is not assignable to type 'User'.
[00:04:47.494]                 Types of property 'id' are incompatible.
[00:04:47.494]                   Type 'unknown' is not assignable to type 'string'.
[00:04:47.494] 
[00:04:47.494] �[0m �[90m 21 |�[39m       type�[33m:�[39m �[32m"credentials"�[39m�[33m,�[39m�[0m
[00:04:47.494] �[0m �[90m 22 |�[39m       credentials�[33m:�[39m {}�[33m,�[39m�[0m
[00:04:47.494] �[0m�[31m�[1m>�[22m�[39m�[90m 23 |�[39m       �[36masync�[39m authorize(credentials�[33m,�[39m req) {�[0m
[00:04:47.494] �[0m �[90m    |�[39m             �[31m�[1m^�[22m�[39m�[0m
[00:04:47.494] �[0m �[90m 24 |�[39m         �[36mconst�[39m { email�[33m,�[39m password } �[33m=�[39m credentials �[36mas�[39m {�[0m
[00:04:47.494] �[0m �[90m 25 |�[39m           email�[33m:�[39m string�[33m;�[39m�[0m
[00:04:47.494] �[0m �[90m 26 |�[39m           password�[33m:�[39m string�[33m;�[39m�[0m
[00:04:47.554] Error: Command "npm run build" exited with 1
[00:04:48.267] 

Copy link
Collaborator

@Shaomei Shaomei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @charansr for working on this. The key requests in my review are:

  1. Componentize functionalities following the ethos of React;
  2. Reduce repeated css / ts code by create reusable classes;
  3. Add relevant tests (unit tests and/or e2e tests) for the new functionalities.

};

return (
<Container maxWidth="sm">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @charansr, can you componentize this ?

import axios from "axios";
import { TextField, Button, Typography, Container } from "@mui/material";

const ForgotPassword: React.FC = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to create a React component for this rather than a new page?

import axios from "axios";
import { useSearchParams } from "next/navigation";

const ResetPassword: React.FC = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here: wouldn't it be better to componentize this function rather than making it a new page?

Comment on lines +50 to +52
<div className="flex items-center justify-center min-h-screen bg-white">
<div className="max-w-md w-full p-6 bg-white rounded-lg">
<h1 className="text-2xl font-semibold mb-6 text-center">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of redundant CSS here as in app/recover-password/page.tsx, please consolidate them into css classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow users to recover password

3 participants