refactor: Simplify authentication and wallet logic by removing debug logs
- Eliminate console logging from the authentication initialization and login processes in useAuth.ts for cleaner code. - Streamline wallet computation in useTicketPurchase.ts by removing unnecessary logging while maintaining functionality. - Refactor LNBits API methods to reduce logging, enhancing code clarity and maintainability.
This commit is contained in:
parent
e1667461be
commit
cd0016744b
3 changed files with 6 additions and 54 deletions
|
|
@ -84,27 +84,11 @@ class LnbitsAPI {
|
|||
(headers as Record<string, string>)['Authorization'] = `Bearer ${this.accessToken}`
|
||||
}
|
||||
|
||||
// Debug logging
|
||||
console.log('LNBits API Request:', {
|
||||
url,
|
||||
method: options.method || 'GET',
|
||||
headers: headers,
|
||||
hasAccessToken: !!this.accessToken,
|
||||
endpoint
|
||||
})
|
||||
|
||||
const response = await fetch(url, {
|
||||
...options,
|
||||
headers,
|
||||
})
|
||||
|
||||
console.log('LNBits API Response:', {
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
ok: response.ok,
|
||||
url: response.url
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text()
|
||||
console.error('LNBits API Error:', {
|
||||
|
|
@ -116,7 +100,6 @@ class LnbitsAPI {
|
|||
}
|
||||
|
||||
const data = await response.json()
|
||||
console.log('LNBits API Response Data:', data)
|
||||
return data
|
||||
}
|
||||
|
||||
|
|
@ -151,10 +134,7 @@ class LnbitsAPI {
|
|||
}
|
||||
|
||||
async getCurrentUser(): Promise<User> {
|
||||
console.log('getCurrentUser called, accessToken:', this.accessToken ? 'present' : 'missing')
|
||||
const user = await this.request<User>('/auth')
|
||||
console.log('getCurrentUser response:', user)
|
||||
return user
|
||||
return this.request<User>('/auth')
|
||||
}
|
||||
|
||||
async updatePassword(currentPassword: string, newPassword: string): Promise<User> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue