Skip to content
Closed
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
1 change: 0 additions & 1 deletion configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const AVAILABLE_PROVIDERS = [
'linkedin',
'linkedinOpenidConnect',
'spotify',
'twitter',
]

/**
Expand Down
9 changes: 0 additions & 9 deletions src/define_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type { ConfigProvider } from '@adonisjs/core/types'
import type { GoogleDriver } from './drivers/google.js'
import type { GithubDriver } from './drivers/github.js'
import type { SpotifyDriver } from './drivers/spotify.js'
import type { TwitterDriver } from './drivers/twitter.js'
import type { DiscordDriver } from './drivers/discord.js'
import type { FacebookDriver } from './drivers/facebook.js'
import type { LinkedInDriver } from './drivers/linked_in.js'
Expand All @@ -24,7 +23,6 @@ import type {
GithubDriverConfig,
SpotifyDriverConfig,
DiscordDriverConfig,
TwitterDriverConfig,
LinkedInDriverConfig,
LinkedInOpenidConnectDriverConfig,
FacebookDriverConfig,
Expand Down Expand Up @@ -85,7 +83,6 @@ export const services: {
config: LinkedInOpenidConnectDriverConfig
) => ConfigProvider<(ctx: HttpContext) => LinkedInOpenidConnectDriver>
spotify: (config: SpotifyDriverConfig) => ConfigProvider<(ctx: HttpContext) => SpotifyDriver>
twitter: (config: TwitterDriverConfig) => ConfigProvider<(ctx: HttpContext) => TwitterDriver>
} = {
discord(config) {
return configProvider.create(async () => {
Expand Down Expand Up @@ -129,10 +126,4 @@ export const services: {
return (ctx) => new SpotifyDriver(ctx, config)
})
},
twitter(config) {
return configProvider.create(async () => {
const { TwitterDriver } = await import('./drivers/twitter.js')
return (ctx) => new TwitterDriver(ctx, config)
})
},
}
150 changes: 0 additions & 150 deletions src/drivers/twitter.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,29 +288,6 @@ export type GithubDriverConfig = Oauth2ClientConfig & {
userEmailUrl?: string
}

/**
* ----------------------------------------
* Twitter driver
* ----------------------------------------
*/

/**
* Shape of the twitter token
*/
export type TwitterToken = {
token: string
secret: string
userId: string
screenName: string
}

/**
* Extra options available for twitter
*/
export type TwitterDriverConfig = Oauth1ClientConfig & {
userInfoUrl?: string
}

/**
* ----------------------------------------
* Google driver
Expand Down
19 changes: 0 additions & 19 deletions tests/define_config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { DiscordDriver } from '../src/drivers/discord.js'
import { FacebookDriver } from '../src/drivers/facebook.js'
import { LinkedInDriver } from '../src/drivers/linked_in.js'
import { SpotifyDriver } from '../src/drivers/spotify.js'
import { TwitterDriver } from '../src/drivers/twitter.js'
import { LinkedInOpenidConnectDriver } from '../src/drivers/linked_in_openid_connect.js'

const BASE_URL = new URL('./', import.meta.url)
Expand Down Expand Up @@ -180,22 +179,4 @@ test.group('Config services', () => {
expectTypeOf(ally.use).parameters.toEqualTypeOf<['spotify']>()
expectTypeOf(ally.use('spotify')).toMatchTypeOf<SpotifyDriver>()
})

test('configure twitter driver', async ({ assert, expectTypeOf }) => {
const managerConfig = await defineConfig({
twitter: services.twitter({
clientId: '',
clientSecret: '',
callbackUrl: '',
}),
}).resolver(app)

const ctx = new HttpContextFactory().create()
const ally = new AllyManager(managerConfig, ctx)

assert.instanceOf(ally.use('twitter'), TwitterDriver)
assert.strictEqual(ally.use('twitter'), ally.use('twitter'))
expectTypeOf(ally.use).parameters.toEqualTypeOf<['twitter']>()
expectTypeOf(ally.use('twitter')).toMatchTypeOf<TwitterDriver>()
})
})