-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace Patreon
current_user
v1 API with identity
v2 API
- Loading branch information
Showing
13 changed files
with
179 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
CREATE TABLE IF NOT EXISTS [users] ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT, | ||
"firstName" VARCHAR(255) NOT NULL, | ||
"fullName" VARCHAR(255) NOT NULL, | ||
"firstName" VARCHAR(255) DEFAULT NULL, | ||
"fullName" VARCHAR(255) DEFAULT NULL, | ||
"gender" UNSIGNED TINYINT NOT NULL DEFAULT 0, | ||
"registrationTimestamp" UNSIGNED INTEGER NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eate-patreon-current-user-request-init.ts → ...n/create-patreon-identity-request-init.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
packages/authn/src/features/patreon/get-patreon-current-user-response.ts
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
packages/authn/src/features/patreon/get-patreon-identity-response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import getFetch from '../../utils/get-fetch.js'; | ||
import createPatreonIdentityRequestInit from './create-patreon-identity-request-init.js'; | ||
import getPatreonOAuthHost from './get-patreon-oauth-host.js'; | ||
|
||
const CAMPAIGN_FIELDS: readonly string[] = ['summary', 'is_monthly']; | ||
|
||
const USER_FIELDS: readonly string[] = [ | ||
'about', | ||
'can_see_nsfw', | ||
// 'comment_count', | ||
'created', | ||
'email', | ||
// 'facebook', | ||
// 'facebook_id', | ||
'first_name', | ||
'full_name', | ||
// 'gender', | ||
'hide_pledges', | ||
'image_url', | ||
'is_email_verified', | ||
'last_name', | ||
'like_count', | ||
'social_connections', | ||
'thumb_url', | ||
// 'twitter', | ||
'url', | ||
'vanity', | ||
// 'youtube', | ||
]; | ||
|
||
const SEARCH: string = [ | ||
`fields%5Bcampaign%5D=${CAMPAIGN_FIELDS.join(',')}`, | ||
`fields%5Buser%5D=${USER_FIELDS.join(',')}`, | ||
].join('&'); | ||
|
||
export default async function getPatreonIdentityResponse(): Promise<Response> { | ||
const fetch: Fetcher['fetch'] = getFetch(); | ||
const oAuthHost: string = getPatreonOAuthHost(); | ||
|
||
return fetch( | ||
`${oAuthHost}/api/oauth2/v2/identity?${SEARCH}`, | ||
await createPatreonIdentityRequestInit(), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.