Fix anon check in SSR apollo client (#2295)
This commit is contained in:
parent
56a185d477
commit
96f149fa79
@ -15,7 +15,7 @@ import { getServerSession } from 'next-auth/next'
|
||||
import { getAuthOptions } from '@/pages/api/auth/[...nextauth]'
|
||||
import { NOFOLLOW_LIMIT } from '@/lib/constants'
|
||||
import { satsToMsats } from '@/lib/format'
|
||||
import { MULTI_AUTH_ANON, MULTI_AUTH_LIST } from '@/lib/auth'
|
||||
import { MULTI_AUTH_ANON, MULTI_AUTH_POINTER } from '@/lib/auth'
|
||||
|
||||
export default async function getSSRApolloClient ({ req, res, me = null }) {
|
||||
const session = req && await getServerSession(req, res, getAuthOptions(req))
|
||||
@ -156,7 +156,7 @@ export function getGetServerSideProps (
|
||||
|
||||
// required to redirect to /signup on page reload
|
||||
// if we switched to anon and authentication is required
|
||||
if (req.cookies[MULTI_AUTH_LIST] === MULTI_AUTH_ANON) {
|
||||
if (req.cookies[MULTI_AUTH_POINTER] === MULTI_AUTH_ANON) {
|
||||
me = null
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user