|
|
@@ -49,22 +49,20 @@ export default function Home({
|
|
49
|
49
|
}
|
|
50
|
50
|
|
|
51
|
51
|
export async function getServerSideProps(context: GetServerSidePropsContext) {
|
|
52
|
|
- const session: any = await getSession(context)
|
|
|
52
|
+ const session = await getSession(context)
|
|
53
|
53
|
|
|
54
|
|
- const handle = session?.user?.login
|
|
|
54
|
+ const image = session?.user?.image
|
|
55
|
55
|
|
|
56
|
56
|
const sponsors = await fetch(
|
|
57
|
57
|
'https://sponsors.trnck.dev/sponsors/steveruizok'
|
|
58
|
58
|
).then((d) => d.json().then((d) => d.sponsors))
|
|
59
|
59
|
|
|
60
|
|
- const sponsor = sponsors.some(
|
|
61
|
|
- (sponsor: { handle: string }) => sponsor.handle === handle
|
|
62
|
|
- )
|
|
|
60
|
+ const sponsor = sponsors.some((sponsor: any) => sponsor.avatar === image)
|
|
63
|
61
|
|
|
64
|
62
|
console.log(
|
|
65
|
|
- session,
|
|
66
|
|
- handle,
|
|
67
|
|
- sponsors.map((sponsor: any) => sponsor.handle)
|
|
|
63
|
+ session?.user,
|
|
|
64
|
+ image,
|
|
|
65
|
+ sponsors.map((sponsor: any) => sponsor.avatar === image)
|
|
68
|
66
|
)
|
|
69
|
67
|
|
|
70
|
68
|
return {
|