Skip to content

Commit 8745f49

Browse files
committed
refactor: add email field to User type
Most backends don't need any change because they already populate this field.
1 parent a004f0d commit 8745f49

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

packages/decap-cms-backend-github/src/API.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,14 @@ export default class API {
253253

254254
static DEFAULT_COMMIT_MESSAGE = 'Automatically generated by Decap CMS';
255255

256-
user(): Promise<{ name: string; login: string }> {
256+
user(): Promise<{ name: string; login: string, email?: string }> {
257257
if (!this._userPromise) {
258258
this._userPromise = this.getUser({ token: this.token });
259259
}
260260
return this._userPromise.then(user => ({
261261
name: user.name || 'Unknown',
262262
login: user.login,
263+
email: user.email ?? undefined,
263264
}));
264265
}
265266

packages/decap-cms-lib-util/src/implementation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export type Credentials = { token: string | {}; refresh_token?: string };
9090
export type User = Credentials & {
9191
backendName?: string;
9292
login?: string;
93+
email?: string;
9394
name: string;
9495
useOpenAuthoring?: boolean;
9596
};

0 commit comments

Comments
 (0)