Skip to content

Commit

Permalink
Updated session strategy
Browse files Browse the repository at this point in the history
Updated DB Session strategy. updated oAuth provider logos.
  • Loading branch information
arifm6 committed Sep 15, 2023
1 parent d1d6273 commit 9be899d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/components/pages/auth/AuthContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactNode } from "react"
import { ClientSafeProvider, LiteralUnion, signIn } from "next-auth/react"
import { BuiltInProviderType } from "next-auth/providers"
import { Button } from "~/components/ui"
import { AiOutlineFacebook, AiOutlineGithub, AiOutlineGoogle } from "react-icons/ai"
import {BiLogoFacebook, BiLogoGithub, BiLogoGoogle } from "react-icons/bi"
import { useRouter } from "next/router"

interface AuthContainerProps {
Expand All @@ -16,11 +16,11 @@ export default function AuthContainer({ children, title, footerHelp, providers }
function getProviderIcon(provider: ClientSafeProvider) {
const providerIcon =
provider.id === "google" ? (
<AiOutlineGoogle className="text-primary-foreground" size={42} />
<BiLogoGoogle className="text-primary-foreground" size={42} />
) : provider.id === "facebook" ? (
<AiOutlineFacebook className="text-primary-foreground" size={42} />
<BiLogoFacebook className="text-primary-foreground" size={42} />
) : (
<AiOutlineGithub className="text-primary-foreground" size={42} />
<BiLogoGithub className="text-primary-foreground" size={42} />
)
return providerIcon
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const authOptions: NextAuthOptions = {
message: "Invalid username or password",
}
}
const isValidPassword = await verify(user.password, creds.password)
const isValidPassword = await verify(user.password as string, creds.password)
if (!isValidPassword) {
return null
}
Expand All @@ -107,7 +107,7 @@ export const authOptions: NextAuthOptions = {
//follow link for more providers https://next-auth.js.org/providers/github
],
session: {
strategy: "jwt",
strategy: "database",
},
}

Expand Down

0 comments on commit 9be899d

Please sign in to comment.