Skip to content

Commit

Permalink
feat(core): fix failing social test
Browse files Browse the repository at this point in the history
  • Loading branch information
bahdcoder committed Sep 25, 2021
1 parent 1771538 commit 115c332
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 83 deletions.
79 changes: 0 additions & 79 deletions packages/core/Setting.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/core/Tensei.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ export class Tensei implements TenseiContract {
}
},
databaseClient: null,
serverUrl:
process.env.SERVER_URL ||
`http://${this.ctx.serverHost}:${this.ctx.port}`,
clientUrl: '',
resources: [],
plugins: [],
Expand Down Expand Up @@ -137,6 +134,9 @@ export class Tensei implements TenseiContract {
pluginsConfig: {}
} as any

this.ctx.serverUrl =
process.env.SERVER_URL || `http://${this.ctx.serverHost}:${this.ctx.port}`

this.ctx.mailer = mail(this.mailerConfig, this.ctx.logger, this.ctx.root)

this.ctx.databaseConfig = {
Expand Down
5 changes: 4 additions & 1 deletion packages/tests/packages/auth/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ test('can signup with social authentication', async () => {
key: 'TEST_KEY',
secret: 'TEST_SECRET'
}
process.env.HOST = '0.0.0.0'
process.env.PORT = '4400'

const { app, ctx } = await setup([
auth()
.verifyEmails()
Expand All @@ -697,7 +700,7 @@ test('can signup with social authentication', async () => {

expect(getResponse.status).toBe(302)
expect(getResponse.headers.location).toBe(
`https://github.com/login/oauth/authorize?client_id=${githubConfig.key}&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3Aundefined%2Fconnect%2Fgithub%2Fcallback&scope=user%2Cuser%3Aemail`
`https://github.com/login/oauth/authorize?client_id=${githubConfig.key}&response_type=code&redirect_uri=http%3A%2F%2F0.0.0.0%3A4400%2Fconnect%2Fgithub%2Fcallback&scope=user%2Cuser%3Aemail`
)

const fakeIdentity = {
Expand Down

0 comments on commit 115c332

Please sign in to comment.