Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nextjs-end/src/lib/firebase/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function signInWithGoogle() {

export async function signOut() {
try {
return auth.signOut();
await auth.signOut();
Copy link

@tusharsinghal1610 tusharsinghal1610 Aug 24, 2025

Choose a reason for hiding this comment

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

In original code, we were returning the result "return auth.signOut();"
should we do instead "return await auth.signOut();" ? just for consistency of return value.

Copy link
Author

Choose a reason for hiding this comment

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

We could, but auth.signOut() returns Promise<void>, so noone should be using the return value anyway.
Additionally the signIn function (signInWithGoogle()) also does not return the value, but simply awaits it.
One might even argue that simply awaiting without returning is more explicit about the intent of this not returning anything.

But ultimately this is a question of taste, so if you like, I can change it...

} catch (error) {
console.error("Error signing out with Google", error);
}
Expand Down