You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey all! Loving Encore TS! I ran into an issue with the generated client this evening.
I have an AuthResponse defined in the following way:
export interface AuthResponse {
cookies: Header<'Set-Cookie'>
user: User
}
When generated, it outputs the following:
public async login(params: LoginParams): Promise<AuthResponse> {
// Now make the actual call to the API
const resp = await this.baseClient.callAPI("POST", `/auth/login`, JSON.stringify(params))
//Populate the return object from the JSON body and received headers
const rtn = await resp.json() as AuthResponse
rtn.cookies = mustBeSet("Header `set-cookie`", resp.headers.get("set-cookie"))
return rtn
}
The mustBeSet call for set-cookie is failing because Set-Cookie is a forbidden response header. Encore itself is setting that header correctly, but the generated client should not expect to be able to access the Set-Cookie header.
The text was updated successfully, but these errors were encountered:
Hey all! Loving Encore TS! I ran into an issue with the generated client this evening.
I have an AuthResponse defined in the following way:
When generated, it outputs the following:
The
mustBeSet
call forset-cookie
is failing becauseSet-Cookie
is a forbidden response header. Encore itself is setting that header correctly, but the generated client should not expect to be able to access theSet-Cookie
header.The text was updated successfully, but these errors were encountered: