Skip to content

Commit

Permalink
refactor: clean up auth strategy files
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Jan 17, 2024
1 parent 5e02f04 commit 198add8
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 28 deletions.
8 changes: 4 additions & 4 deletions libs/api/auth/data-access/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export * from './lib/guards/api-anon-jwt-guard'
export * from './lib/guards/api-auth-graphql-admin-guard'
export * from './lib/guards/api-auth-graphql-user-guard'
export * from './lib/interfaces/api-auth.request'
export * from './lib/strategies/oauth/api-auth-strategy-discord-guard'
export * from './lib/strategies/oauth/api-auth-strategy-github-guard'
export * from './lib/strategies/oauth/api-auth-strategy-google-guard'
export * from './lib/strategies/oauth/api-auth-strategy-twitter-guard'
export * from './lib/strategies/oauth/api-auth-strategy-discord'
export * from './lib/strategies/oauth/api-auth-strategy-github'
export * from './lib/strategies/oauth/api-auth-strategy-google'
export * from './lib/strategies/oauth/api-auth-strategy-twitter'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Injectable } from '@nestjs/common'
import { PassportStrategy } from '@nestjs/passport'
import { AuthGuard, PassportStrategy } from '@nestjs/passport'
import { IdentityProvider } from '@prisma/client'
import { ApiCoreService } from '@pubkey-stack/api-core-data-access'
import { Profile, Strategy } from 'passport-discord'
import type { ApiAuthRequest } from '../../interfaces/api-auth.request'
import { ApiAuthStrategyService } from '../api-auth-strategy.service'

@Injectable()
export class ApiAuthStrategyDiscordGuard extends AuthGuard('discord') {}

@Injectable()
export class ApiAuthStrategyDiscord extends PassportStrategy(Strategy, 'discord') {
constructor(private core: ApiCoreService, private service: ApiAuthStrategyService) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Injectable } from '@nestjs/common'
import { PassportStrategy } from '@nestjs/passport'
import { AuthGuard, PassportStrategy } from '@nestjs/passport'
import { IdentityProvider } from '@prisma/client'
import { ApiCoreService } from '@pubkey-stack/api-core-data-access'
import { Profile, Strategy } from 'passport-github'
import type { ApiAuthRequest } from '../../interfaces/api-auth.request'
import { ApiAuthStrategyService } from '../api-auth-strategy.service'

@Injectable()
export class ApiAuthStrategyGithubGuard extends AuthGuard('github') {}

@Injectable()
export class ApiAuthStrategyGithub extends PassportStrategy(Strategy, 'github') {
constructor(private core: ApiCoreService, private service: ApiAuthStrategyService) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Injectable } from '@nestjs/common'
import { PassportStrategy } from '@nestjs/passport'
import { AuthGuard, PassportStrategy } from '@nestjs/passport'
import { IdentityProvider } from '@prisma/client'
import { ApiCoreService } from '@pubkey-stack/api-core-data-access'
import { Profile, Strategy } from 'passport-google-oauth20'
import type { ApiAuthRequest } from '../../interfaces/api-auth.request'
import { ApiAuthStrategyService } from '../api-auth-strategy.service'

@Injectable()
export class ApiAuthStrategyGoogleGuard extends AuthGuard('google') {}

@Injectable()
export class ApiAuthStrategyGoogle extends PassportStrategy(Strategy, 'google') {
constructor(private core: ApiCoreService, private service: ApiAuthStrategyService) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Injectable } from '@nestjs/common'
import { PassportStrategy } from '@nestjs/passport'
import { AuthGuard, PassportStrategy } from '@nestjs/passport'
import { IdentityProvider } from '@prisma/client'
import { ApiCoreService } from '@pubkey-stack/api-core-data-access'
import { Profile, Strategy } from 'passport-twitter'
import type { ApiAuthRequest } from '../../interfaces/api-auth.request'
import { ApiAuthStrategyService } from '../api-auth-strategy.service'

@Injectable()
export class ApiAuthStrategyTwitterGuard extends AuthGuard('twitter') {}

@Injectable()
export class ApiAuthStrategyTwitter extends PassportStrategy(Strategy, 'twitter') {
constructor(private core: ApiCoreService, private service: ApiAuthStrategyService) {
Expand Down

0 comments on commit 198add8

Please sign in to comment.