Compare commits
No commits in common. "d8c604172a544c84790f5fc7786876bc466fb4aa" and "5b7ff2495514ebcb5f306315457cb3dd0d9277e9" have entirely different histories.
d8c604172a
...
5b7ff24955
24
awards.csv
24
awards.csv
@ -175,17 +175,17 @@ SatsAllDay,issue,#1820,#1819,easy,,,1,9k,weareallsatoshi@getalby.com,2025-01-27
|
|||||||
Soxasora,pr,#1814,#1736,easy,,,,100k,soxasora@blink.sv,2025-01-27
|
Soxasora,pr,#1814,#1736,easy,,,,100k,soxasora@blink.sv,2025-01-27
|
||||||
jason-me,pr,#1857,,easy,,,,100k,rrbtc@vlt.ge,2025-02-08
|
jason-me,pr,#1857,,easy,,,,100k,rrbtc@vlt.ge,2025-02-08
|
||||||
ed-kung,pr,#1901,#323,good-first-issue,,,,20k,simplestacker@getalby.com,2025-02-14
|
ed-kung,pr,#1901,#323,good-first-issue,,,,20k,simplestacker@getalby.com,2025-02-14
|
||||||
Scroogey-SN,pr,#1911,#1905,good-first-issue,,,1,18k,Scroogey@coinos.io,2025-03-10
|
Scroogey-SN,pr,#1911,#1905,good-first-issue,,,1,18k,Scroogey@coinos.io,???
|
||||||
Scroogey-SN,pr,#1928,#1924,good-first-issue,,,,20k,Scroogey@coinos.io,2025-03-10
|
Scroogey-SN,pr,#1928,#1924,good-first-issue,,,,20k,Scroogey@coinos.io,???
|
||||||
dtonon,issue,#1928,#1924,good-first-issue,,,,2k,???,???
|
dtonon,issue,#1928,#1924,good-first-issue,,,,2k,???,???
|
||||||
ed-kung,pr,#1926,#1914,medium-hard,,,,500k,simplestacker@getalby.com,2025-03-10
|
ed-kung,pr,#1926,#1914,medium-hard,,,,500k,simplestacker@getalby.com,???
|
||||||
ed-kung,issue,#1926,#1914,medium-hard,,,,50k,simplestacker@getalby.com,2025-03-10
|
ed-kung,issue,#1926,#1914,medium-hard,,,,50k,simplestacker@getalby.com,???
|
||||||
ed-kung,pr,#1926,#1927,easy,,,,100k,simplestacker@getalby.com,2025-03-10
|
ed-kung,pr,#1926,#1927,easy,,,,100k,simplestacker@getalby.com,???
|
||||||
ed-kung,issue,#1926,#1927,easy,,,,10k,simplestacker@getalby.com,2025-03-10
|
ed-kung,issue,#1926,#1927,easy,,,,10k,simplestacker@getalby.com,???
|
||||||
ed-kung,issue,#1913,#1890,good-first-issue,,,,2k,simplestacker@getalby.com,2025-03-10
|
ed-kung,issue,#1913,#1890,good-first-issue,,,,2k,simplestacker@getalby.com,???
|
||||||
Scroogey-SN,pr,#1930,#1167,good-first-issue,,,,20k,Scroogey@coinos.io,2025-03-10
|
Scroogey-SN,pr,#1930,#1167,good-first-issue,,,,20k,Scroogey@coinos.io,???
|
||||||
itsrealfake,issue,#1930,#1167,good-first-issue,,,,2k,smallimagination100035@getalby.com,???
|
itsrealfake,issue,#1930,#1167,good-first-issue,,,,2k,smallimagination100035@getalby.com,???
|
||||||
Scroogey-SN,pr,#1948,#1849,medium,urgent,,,750k,Scroogey@coinos.io,2025-03-10
|
Scroogey-SN,pr,#1948,#1849,medium,urgent,,,750k,Scroogey@coinos.io,???
|
||||||
felipebueno,issue,#1947,#1945,good-first-issue,,,,2k,felipebueno@blink.sv,2025-03-10
|
felipebueno,issue,#1947,#1945,good-first-issue,,,,2k,felipebueno@blink.sv,???
|
||||||
ed-kung,pr,#1952,#1951,easy,,,,100k,simplestacker@getalby.com,2025-03-10
|
ed-kung,pr,#1952,#1951,easy,,,,100k,simplestacker@getalby.com,???
|
||||||
ed-kung,issue,#1952,#1951,easy,,,,10k,simplestacker@getalby.com,2025-03-10
|
ed-kung,issue,#1952,#1951,easy,,,,10k,simplestacker@getalby.com,???
|
||||||
|
|
@ -7,6 +7,7 @@ import EmailProvider from 'next-auth/providers/email'
|
|||||||
import prisma from '@/api/models'
|
import prisma from '@/api/models'
|
||||||
import nodemailer from 'nodemailer'
|
import nodemailer from 'nodemailer'
|
||||||
import { PrismaAdapter } from '@auth/prisma-adapter'
|
import { PrismaAdapter } from '@auth/prisma-adapter'
|
||||||
|
import { NodeNextRequest, NodeNextResponse } from 'next/dist/server/base-http/node'
|
||||||
import { getToken, encode as encodeJWT } from 'next-auth/jwt'
|
import { getToken, encode as encodeJWT } from 'next-auth/jwt'
|
||||||
import { datePivot } from '@/lib/time'
|
import { datePivot } from '@/lib/time'
|
||||||
import { schnorr } from '@noble/curves/secp256k1'
|
import { schnorr } from '@noble/curves/secp256k1'
|
||||||
@ -129,7 +130,7 @@ function getCallbacks (req, res) {
|
|||||||
const secret = process.env.NEXTAUTH_SECRET
|
const secret = process.env.NEXTAUTH_SECRET
|
||||||
const jwt = await encodeJWT({ token, secret })
|
const jwt = await encodeJWT({ token, secret })
|
||||||
const me = await prisma.user.findUnique({ where: { id: token.id } })
|
const me = await prisma.user.findUnique({ where: { id: token.id } })
|
||||||
setMultiAuthCookies(req, res, { ...me, jwt })
|
setMultiAuthCookies(new NodeNextRequest(req), new NodeNextResponse(res), { ...me, jwt })
|
||||||
}
|
}
|
||||||
|
|
||||||
return token
|
return token
|
||||||
@ -179,7 +180,8 @@ async function pubkeyAuth (credentials, req, res, pubkeyColumnName) {
|
|||||||
const { k1, pubkey } = credentials
|
const { k1, pubkey } = credentials
|
||||||
|
|
||||||
// are we trying to add a new account for switching between?
|
// are we trying to add a new account for switching between?
|
||||||
const multiAuth = typeof req.body.multiAuth === 'string' ? req.body.multiAuth === 'true' : !!req.body.multiAuth
|
const { body } = req.body
|
||||||
|
const multiAuth = typeof body.multiAuth === 'string' ? body.multiAuth === 'true' : !!body.multiAuth
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// does the given challenge (k1) exist in our db?
|
// does the given challenge (k1) exist in our db?
|
||||||
@ -260,7 +262,7 @@ const getProviders = res => [
|
|||||||
k1: { label: 'k1', type: 'text' }
|
k1: { label: 'k1', type: 'text' }
|
||||||
},
|
},
|
||||||
authorize: async (credentials, req) => {
|
authorize: async (credentials, req) => {
|
||||||
return await pubkeyAuth(credentials, req, res, 'pubkey')
|
return await pubkeyAuth(credentials, new NodeNextRequest(req), new NodeNextResponse(res), 'pubkey')
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
CredentialsProvider({
|
CredentialsProvider({
|
||||||
@ -271,7 +273,7 @@ const getProviders = res => [
|
|||||||
},
|
},
|
||||||
authorize: async ({ event }, req) => {
|
authorize: async ({ event }, req) => {
|
||||||
const credentials = await nostrEventAuth(event)
|
const credentials = await nostrEventAuth(event)
|
||||||
return await pubkeyAuth(credentials, req, res, 'nostrAuthPubkey')
|
return await pubkeyAuth(credentials, new NodeNextRequest(req), new NodeNextResponse(res), 'nostrAuthPubkey')
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
GitHubProvider({
|
GitHubProvider({
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
ApolloServerPluginLandingPageLocalDefault,
|
ApolloServerPluginLandingPageLocalDefault,
|
||||||
ApolloServerPluginLandingPageProductionDefault
|
ApolloServerPluginLandingPageProductionDefault
|
||||||
} from '@apollo/server/plugin/landingPage/default'
|
} from '@apollo/server/plugin/landingPage/default'
|
||||||
import { NodeNextRequest } from 'next/dist/server/base-http/node'
|
|
||||||
|
|
||||||
const apolloServer = new ApolloServer({
|
const apolloServer = new ApolloServer({
|
||||||
typeDefs,
|
typeDefs,
|
||||||
@ -86,12 +85,6 @@ export default startServerAndCreateNextHandler(apolloServer, {
|
|||||||
export function multiAuthMiddleware (request) {
|
export function multiAuthMiddleware (request) {
|
||||||
// switch next-auth session cookie with multi_auth cookie if cookie pointer present
|
// switch next-auth session cookie with multi_auth cookie if cookie pointer present
|
||||||
|
|
||||||
if (!request.cookies) {
|
|
||||||
// required to properly access parsed cookies via request.cookies
|
|
||||||
// and not unparsed via request.headers.cookie
|
|
||||||
request = new NodeNextRequest(request)
|
|
||||||
}
|
|
||||||
|
|
||||||
// is there a cookie pointer?
|
// is there a cookie pointer?
|
||||||
const cookiePointerName = 'multi_auth.user-id'
|
const cookiePointerName = 'multi_auth.user-id'
|
||||||
const hasCookiePointer = !!request.cookies[cookiePointerName]
|
const hasCookiePointer = !!request.cookies[cookiePointerName]
|
||||||
|
@ -176,7 +176,7 @@ async function fetchItem (id) {
|
|||||||
async function fetchUserItems (name) {
|
async function fetchUserItems (name) {
|
||||||
const data = await gql(`
|
const data = await gql(`
|
||||||
query UserItems($name: String!) {
|
query UserItems($name: String!) {
|
||||||
items(sort: "user", type: "all", limit: 999, name: $name) {
|
items(sort: "user", name: $name) {
|
||||||
items {
|
items {
|
||||||
id
|
id
|
||||||
createdAt
|
createdAt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user