Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/auth-js/src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3649,8 +3649,8 @@ export default class GoTrueClient {
raw: { header: rawHeader, payload: rawPayload },
} = decodeJWT(token)

if (!options?.allowExpired) {
// Reject expired JWTs should only happen if jwt argument was passed
// Only validate expiration if allowExpired is NOT true
if (options?.allowExpired !== true) {
validateExp(payload.exp)
}

Expand Down
7 changes: 7 additions & 0 deletions packages/core/postgrest-js/src/PostgrestQueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ export default class PostgrestQueryBuilder<
}
}

// Automatically use RETURNING for inserts so `.select()` works without SELECT policy
if (!this.headers.has('Prefer')) {
this.headers.append('Prefer', 'return=representation')
} else if (![...this.headers.values()].some((h) => h.includes('return='))) {
this.headers.append('Prefer', 'return=representation')
}

return new PostgrestFilterBuilder({
method,
url: this.url,
Expand Down
Loading