remove slashtags completely
This commit is contained in:
parent
ddb69b5d9b
commit
df6575d701
|
@ -18,9 +18,6 @@ LOGIN_EMAIL_FROM=<YOUR FROM ALIAS>
|
|||
# lnurl-auth
|
||||
LNAUTH_URL=<YOUR PUBLIC TUNNEL TO LOCALHOST, e.g. NGROK>
|
||||
|
||||
# slashtags
|
||||
SLASHTAGS_SECRET=
|
||||
|
||||
# VAPID for Web Push
|
||||
VAPID_MAILTO=
|
||||
NEXT_PUBLIC_VAPID_PUBKEY=
|
||||
|
|
|
@ -51,6 +51,3 @@ sw/precache-manifest.json
|
|||
public/workbox-*.js*
|
||||
public/*-development.js
|
||||
|
||||
# slashtags
|
||||
.slashtags/
|
||||
|
||||
|
|
|
@ -40,9 +40,6 @@ export default {
|
|||
encodedUrl: async (lnAuth, args, { models }) => {
|
||||
return encodedUrl(process.env.LNAUTH_URL, 'login', lnAuth.k1)
|
||||
}
|
||||
// slashtagUrl: async (lnAuth, args, { models, slashtags }) => {
|
||||
// return slashtags.formatURL(lnAuth.k1)
|
||||
// }
|
||||
},
|
||||
LnWith: {
|
||||
encodedUrl: async (lnWith, args, { models }) => {
|
||||
|
|
|
@ -80,7 +80,6 @@ async function authMethods (user, args, { models, me }) {
|
|||
email: user.emailVerified && user.email,
|
||||
twitter: oauth.indexOf('twitter') >= 0,
|
||||
github: oauth.indexOf('github') >= 0,
|
||||
slashtags: !!user.slashtagId,
|
||||
nostr: !!user.nostrAuthPubkey
|
||||
}
|
||||
}
|
||||
|
@ -526,8 +525,6 @@ export default {
|
|||
await models.account.delete({ where: { id: account.id } })
|
||||
} else if (authType === 'lightning') {
|
||||
user = await models.user.update({ where: { id: me.id }, data: { pubkey: null } })
|
||||
} else if (authType === 'slashtags') {
|
||||
user = await models.user.update({ where: { id: me.id }, data: { slashtagId: null } })
|
||||
} else if (authType === 'nostr') {
|
||||
user = await models.user.update({ where: { id: me.id }, data: { nostrAuthPubkey: null } })
|
||||
} else if (authType === 'email') {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -34,7 +34,6 @@ export default gql`
|
|||
|
||||
type AuthMethods {
|
||||
lightning: Boolean!
|
||||
slashtags: Boolean!
|
||||
nostr: Boolean!
|
||||
github: Boolean!
|
||||
twitter: Boolean!
|
||||
|
|
|
@ -11,7 +11,7 @@ import BackIcon from '../svgs/arrow-left-line.svg'
|
|||
import { useRouter } from 'next/router'
|
||||
import { SSR } from '../lib/constants'
|
||||
|
||||
function QrAuth ({ k1, encodedUrl, slashtagUrl, callbackUrl }) {
|
||||
function QrAuth ({ k1, encodedUrl, callbackUrl }) {
|
||||
const query = gql`
|
||||
{
|
||||
lnAuth(k1: "${k1}") {
|
||||
|
@ -23,13 +23,13 @@ function QrAuth ({ k1, encodedUrl, slashtagUrl, callbackUrl }) {
|
|||
|
||||
useEffect(() => {
|
||||
if (data?.lnAuth?.pubkey) {
|
||||
signIn(encodedUrl ? 'lightning' : 'slashtags', { ...data.lnAuth, callbackUrl })
|
||||
signIn('lightning', { ...data.lnAuth, callbackUrl })
|
||||
}
|
||||
}, [data?.lnAuth])
|
||||
|
||||
// output pubkey and k1
|
||||
return (
|
||||
<Qr value={encodedUrl || slashtagUrl} asIs={!!slashtagUrl} status='waiting for you' />
|
||||
<Qr value={encodedUrl} status='waiting for you' />
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -115,22 +115,3 @@ export function LightningAuth ({ callbackUrl }) {
|
|||
|
||||
return data ? <QrAuth {...data.createAuth} callbackUrl={callbackUrl} /> : <QrSkeleton status='generating' />
|
||||
}
|
||||
|
||||
export function SlashtagsAuth ({ callbackUrl }) {
|
||||
// query for challenge
|
||||
const [createAuth, { data, error }] = useMutation(gql`
|
||||
mutation createAuth {
|
||||
createAuth {
|
||||
k1
|
||||
slashtagUrl
|
||||
}
|
||||
}`)
|
||||
|
||||
useEffect(() => {
|
||||
createAuth()
|
||||
}, [])
|
||||
|
||||
if (error) return <div>error</div>
|
||||
|
||||
return data ? <QrAuth {...data.createAuth} callbackUrl={callbackUrl} /> : <QrSkeleton status='generating' />
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import GithubIcon from '../svgs/github-fill.svg'
|
||||
import TwitterIcon from '../svgs/twitter-fill.svg'
|
||||
import LightningIcon from '../svgs/bolt.svg'
|
||||
import SlashtagsIcon from '../svgs/slashtags.svg'
|
||||
import NostrIcon from '../svgs/nostr.svg'
|
||||
import Button from 'react-bootstrap/Button'
|
||||
|
||||
|
@ -16,10 +15,6 @@ export default function LoginButton ({ text, type, className, onClick }) {
|
|||
Icon = GithubIcon
|
||||
variant = 'dark'
|
||||
break
|
||||
case 'slashtags':
|
||||
Icon = SlashtagsIcon
|
||||
variant = 'grey-medium'
|
||||
break
|
||||
case 'nostr':
|
||||
Icon = NostrIcon
|
||||
variant = 'nostr'
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Form, Input, SubmitButton } from '../components/form'
|
|||
import { useState } from 'react'
|
||||
import Alert from 'react-bootstrap/Alert'
|
||||
import { useRouter } from 'next/router'
|
||||
import { LightningAuthWithExplainer, SlashtagsAuth } from './lightning-auth'
|
||||
import { LightningAuthWithExplainer } from './lightning-auth'
|
||||
import NostrAuth from './nostr-auth'
|
||||
import LoginButton from './login-button'
|
||||
import { emailSchema } from '../lib/validate'
|
||||
|
@ -56,10 +56,6 @@ export default function Login ({ providers, callbackUrl, error, text, Header, Fo
|
|||
return <LightningAuthWithExplainer callbackUrl={callbackUrl} text={text} />
|
||||
}
|
||||
|
||||
if (router.query.type === 'slashtags') {
|
||||
return <SlashtagsAuth callbackUrl={callbackUrl} text={text} />
|
||||
}
|
||||
|
||||
if (router.query.type === 'nostr') {
|
||||
return <NostrAuth callbackUrl={callbackUrl} text={text} />
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -18,8 +18,6 @@
|
|||
"@noble/curves": "^1.1.0",
|
||||
"@opensearch-project/opensearch": "^2.3.1",
|
||||
"@prisma/client": "^5.1.1",
|
||||
"@synonymdev/slashtags-auth": "^1.0.0-alpha.5",
|
||||
"@synonymdev/slashtags-sdk": "^1.0.0-alpha.36",
|
||||
"acorn": "^8.10.0",
|
||||
"ajv": "^8.12.0",
|
||||
"async-retry": "^1.3.1",
|
||||
|
|
|
@ -97,7 +97,6 @@ function MyApp ({ Component, pageProps: { ...props } }) {
|
|||
</PaymentTokenProvider>
|
||||
</LightningProvider>
|
||||
</PriceProvider>
|
||||
|
||||
</ServiceWorkerProvider>
|
||||
</MeProvider>
|
||||
</ApolloProvider>
|
||||
|
|
|
@ -156,15 +156,6 @@ const providers = [
|
|||
return pubkeyAuth(credentials, new NodeNextRequest(req), 'nostrAuthPubkey')
|
||||
}
|
||||
}),
|
||||
// CredentialsProvider({
|
||||
// id: 'slashtags',
|
||||
// name: 'Slashtags',
|
||||
// credentials: {
|
||||
// pubkey: { label: 'publickey', type: 'text' },
|
||||
// k1: { label: 'k1', type: 'text' }
|
||||
// },
|
||||
// authorize: async (credentials, req) => await pubkeyAuth(credentials, new NodeNextRequest(req), 'slashtagId')
|
||||
// }),
|
||||
GitHubProvider({
|
||||
clientId: process.env.GITHUB_ID,
|
||||
clientSecret: process.env.GITHUB_SECRET,
|
||||
|
|
|
@ -8,7 +8,7 @@ import { gql, useMutation, useQuery } from '@apollo/client'
|
|||
import { getGetServerSideProps } from '../api/ssrApollo'
|
||||
import LoginButton from '../components/login-button'
|
||||
import { signIn } from 'next-auth/react'
|
||||
import { LightningAuth, SlashtagsAuth } from '../components/lightning-auth'
|
||||
import { LightningAuth } from '../components/lightning-auth'
|
||||
import { SETTINGS, SET_SETTINGS } from '../fragments/users'
|
||||
import { useRouter } from 'next/router'
|
||||
import Info from '../components/info'
|
||||
|
@ -293,7 +293,7 @@ function QRLinkButton ({ provider, unlink, status }) {
|
|||
? unlink
|
||||
: () => showModal(onClose =>
|
||||
<div className='d-flex flex-column align-items-center'>
|
||||
{provider === 'slashtags' ? <SlashtagsAuth /> : <LightningAuth />}
|
||||
<LightningAuth />
|
||||
</div>)
|
||||
|
||||
return (
|
||||
|
@ -434,7 +434,7 @@ function AuthMethods ({ methods }) {
|
|||
</div>
|
||||
)
|
||||
: <div key={provider} className='mt-2'><EmailLinkForm /></div>
|
||||
} else if (provider === 'lightning' || provider === 'slashtags') {
|
||||
} else if (provider === 'lightning') {
|
||||
return (
|
||||
<QRLinkButton
|
||||
key={provider} provider={provider}
|
||||
|
|
Loading…
Reference in New Issue