Skip to content

Commit

Permalink
fix: remove address addition
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSinclair committed Oct 15, 2024
1 parent 00fd502 commit 8b80b8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions {
async authorize(credentials: any) {
try {
const siweMessage = parseSiweMessage(
credentials?.message!,
credentials?.message,
) as SiweMessage;

if (
!validateSiweMessage({
address: credentials?.address,
address: siweMessage?.address,
message: siweMessage,
})
) {
Expand Down Expand Up @@ -55,7 +55,7 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions {
}

const valid = await publicClient.verifyMessage({
address: credentials?.address,
address: siweMessage?.address,
message: credentials?.message,
signature: credentials?.signature,
});
Expand All @@ -81,12 +81,7 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions {
label: 'Signature',
placeholder: '0x0',
type: 'text',
},
address: {
label: 'Address',
placeholder: '0x0',
type: 'text',
},
}
},
name: 'Ethereum',
}),
Expand Down
11 changes: 3 additions & 8 deletions packages/example/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions {
async authorize(credentials: any) {
try {
const siweMessage = parseSiweMessage(
credentials?.message!,
credentials?.message,
) as SiweMessage;

if (
!validateSiweMessage({
address: credentials?.address,
address: siweMessage?.address,
message: siweMessage,
})
) {
Expand Down Expand Up @@ -55,7 +55,7 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions {
}

const valid = await publicClient.verifyMessage({
address: credentials?.address,
address: siweMessage?.address,
message: credentials?.message,
signature: credentials?.signature,
});
Expand Down Expand Up @@ -83,11 +83,6 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions {
placeholder: '0x0',
type: 'text',
},
address: {
label: 'Address',
placeholder: '0x0',
type: 'text',
},
},
name: 'Ethereum',
}),
Expand Down

0 comments on commit 8b80b8d

Please sign in to comment.