File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ describe('Auth enhancements', () => {
389389 } ) ;
390390 expect ( result . data . token ) . toBe ( 'new-token' ) ;
391391 const [ url , opts ] = fetchMock . mock . calls [ 0 ] ;
392- expect ( url ) . toContain ( '/api/v1/auth/register ' ) ;
392+ expect ( url ) . toContain ( '/api/v1/auth/sign-up/email ' ) ; // Updated to better-auth endpoint
393393 expect ( opts . method ) . toBe ( 'POST' ) ;
394394 // Token should be auto-set
395395 expect ( ( client as any ) . token ) . toBe ( 'new-token' ) ;
@@ -402,10 +402,8 @@ describe('Auth enhancements', () => {
402402 const result = await client . auth . refreshToken ( 'old-refresh-token' ) ;
403403 expect ( result . data . token ) . toBe ( 'refreshed-token' ) ;
404404 const [ url , opts ] = fetchMock . mock . calls [ 0 ] ;
405- expect ( url ) . toContain ( '/api/v1/auth/refresh' ) ;
406- expect ( opts . method ) . toBe ( 'POST' ) ;
407- const body = JSON . parse ( opts . body ) ;
408- expect ( body . refreshToken ) . toBe ( 'old-refresh-token' ) ;
405+ expect ( url ) . toContain ( '/api/v1/auth/get-session' ) ; // Updated: better-auth uses get-session for refresh
406+ expect ( opts . method ) . toBe ( 'GET' ) ; // Updated: GET instead of POST
409407 // Token should be auto-set
410408 expect ( ( client as any ) . token ) . toBe ( 'refreshed-token' ) ;
411409 } ) ;
Original file line number Diff line number Diff line change @@ -537,8 +537,9 @@ export class ObjectStackClient {
537537 /**
538538 * Refresh an authentication token
539539 * Note: better-auth handles token refresh automatically via /get-session
540+ * @param _refreshToken - Not used (better-auth handles refresh automatically)
540541 */
541- refreshToken : async ( refreshToken : string ) : Promise < SessionResponse > => {
542+ refreshToken : async ( _refreshToken : string ) : Promise < SessionResponse > => {
542543 const route = this . getRoute ( 'auth' ) ;
543544 // better-auth doesn't have a separate refresh endpoint
544545 // Session refresh is handled automatically when calling /get-session
You can’t perform that action at this time.
0 commit comments