Skip to content

Commit

Permalink
auth.ts -> utils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rkyslyy committed Jul 3, 2024
1 parent b82400c commit 4c96b21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/app/lib/auth/auth.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextAuthConfig, Session } from 'next-auth'
import CognitoProvider from 'next-auth/providers/cognito'
import { COGNITO_CLIENT_ID, COGNITO_USER_POOL_ID, REGION } from '@/config'
import { refreshTokensIfNeeded } from './auth'
import { refreshTokensIfNeeded } from './utils'

if (process.env.NEXTAUTH_URL && process.env.NEXTAUTH_URL.includes('set-me-in-.env')) {
console.error(`Please set WEB_DOMAIN in .env.${process.env.SST_STAGE} to the URL of your frontend site.`)
Expand Down
2 changes: 1 addition & 1 deletion web/app/lib/auth/auth.ts → web/app/lib/auth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface CognitoRefreshTokenResult {
refresh_token: string
}

export const refreshCognitoAccessToken = async (tokens: JWT): Promise<CognitoRefreshTokenResult> => {
const refreshCognitoAccessToken = async (tokens: JWT): Promise<CognitoRefreshTokenResult> => {
if (!COGNITO_CLIENT_ID) throw new Error('COGNITO_CLIENT_ID is not set')
if (!COGNITO_DOMAIN_NAME) throw new Error('COGNITO_DOMAIN_NAME is not set')

Expand Down

0 comments on commit 4c96b21

Please sign in to comment.