Claude Code Companion
Tool Call

edit_file

Updating login logic to use new SDK

Target File
description src/lib/auth.ts
Status
check_circle Dry-run Success
Lines Modified
edit_note +12 / -8 lines
src/lib/auth.ts — Diff View
L64 — L78
64 export async function login(credentials: LoginCredentials) {
65 try {
66 - const response = await legacyAuthService.authenticate({
67 - user: credentials.username,
68 - pass: credentials.password
69 - });
66 + const client = await getAuthSDKInstance();
67 + const response = await client.v2.signIn({
68 + identifier: credentials.username,
69 + secret: credentials.password,
70 + options: { persistent: true }
71 + });
72
73 if (response.status === 200) {
74 return response.data;

Implementation Context

psychology

Reasoning

The `legacyAuthService` was deprecated in RFC-204. The new SDK provides automatic session refresh and better error typing. This migration ensures the login flow is compliant with the new security standards.

science

Impact Analysis

No changes needed in calling components. The interface remains compatible but internal state management is improved.

description
auth.ts
keyboard_double_arrow_right
check_circle
Verified