mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 09:01:00 +00:00
fix(lint): remove unused keyMaterial variable + stale eslint-disable in LandingPageDesktop
This commit is contained in:
@@ -40,7 +40,6 @@ const SPRITE_STYLES = `
|
|||||||
const Sprite: React.FC = () => (
|
const Sprite: React.FC = () => (
|
||||||
<svg className="lp-sprite" aria-hidden="true">
|
<svg className="lp-sprite" aria-hidden="true">
|
||||||
<defs>
|
<defs>
|
||||||
{/* eslint-disable-next-line react/no-danger */}
|
|
||||||
<style dangerouslySetInnerHTML={{ __html: SPRITE_STYLES }} />
|
<style dangerouslySetInnerHTML={{ __html: SPRITE_STYLES }} />
|
||||||
{/* Finance */}
|
{/* Finance */}
|
||||||
<symbol id="lp-i-wallet" viewBox="0 0 32 32">
|
<symbol id="lp-i-wallet" viewBox="0 0 32 32">
|
||||||
|
|||||||
@@ -14,16 +14,8 @@ async function verifyTelegramHash(data: Record<string, string>, botToken: string
|
|||||||
.map(([k, v]) => `${k}=${v}`)
|
.map(([k, v]) => `${k}=${v}`)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
|
|
||||||
// secret_key = SHA-256(bot_token)
|
// Telegram Login Widget: secret_key = SHA-256(bot_token), used as HMAC key
|
||||||
const encoder = new TextEncoder()
|
const encoder = new TextEncoder()
|
||||||
const keyMaterial = await crypto.subtle.importKey(
|
|
||||||
'raw',
|
|
||||||
encoder.encode(botToken),
|
|
||||||
{ name: 'HMAC', hash: 'SHA-256' },
|
|
||||||
false,
|
|
||||||
['sign']
|
|
||||||
)
|
|
||||||
// Telegram Login Widget uses SHA-256(bot_token) as HMAC key — import as raw bytes
|
|
||||||
const secretKeyBytes = await crypto.subtle.digest('SHA-256', encoder.encode(botToken))
|
const secretKeyBytes = await crypto.subtle.digest('SHA-256', encoder.encode(botToken))
|
||||||
const hmacKey = await crypto.subtle.importKey(
|
const hmacKey = await crypto.subtle.importKey(
|
||||||
'raw',
|
'raw',
|
||||||
|
|||||||
Reference in New Issue
Block a user