fix: .js toevoegen aan imports
This commit is contained in:
		
							parent
							
								
									0b2c90c8b5
								
							
						
					
					
						commit
						d9f7b500c8
					
				
					 6 changed files with 13 additions and 13 deletions
				
			
		|  | @ -11,8 +11,8 @@ import submissionRouter from './routes/submission.js'; | |||
| import classRouter from './routes/class.js'; | ||||
| import questionRouter from './routes/question.js'; | ||||
| import authRouter from './routes/auth.js'; | ||||
| import {authenticateUser} from "./middleware/auth/auth"; | ||||
| import cors from "./middleware/cors"; | ||||
| import {authenticateUser} from "./middleware/auth/auth.js"; | ||||
| import cors from "./middleware/cors.js"; | ||||
| 
 | ||||
| const app: Express = express(); | ||||
| const port: string | number = getNumericEnvVar(EnvVars.Port); | ||||
|  |  | |||
|  | @ -1,9 +1,4 @@ | |||
| import {EnvVars, getEnvVar} from "../util/envvars"; | ||||
| 
 | ||||
| type FrontendAuthConfig = { | ||||
|     student: FrontendIdpConfig, | ||||
|     teacher: FrontendIdpConfig | ||||
| } | ||||
| import {EnvVars, getEnvVar} from "../util/envvars.js"; | ||||
| 
 | ||||
| type FrontendIdpConfig = { | ||||
|     authority: string, | ||||
|  | @ -12,6 +7,11 @@ type FrontendIdpConfig = { | |||
|     responseType: string | ||||
| } | ||||
| 
 | ||||
| type FrontendAuthConfig = { | ||||
|     student: FrontendIdpConfig, | ||||
|     teacher: FrontendIdpConfig | ||||
| } | ||||
| 
 | ||||
| const SCOPE = "openid profile email"; | ||||
| const RESPONSE_TYPE = "code"; | ||||
| 
 | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ import jwksClient from 'jwks-rsa'; | |||
| import * as express from "express"; | ||||
| import * as jwt from "jsonwebtoken"; | ||||
| import {AuthenticatedRequest} from "./authenticated-request.js"; | ||||
| import {AuthenticationInfo} from "./authentication-info"; | ||||
| import {AuthenticationInfo} from "./authentication-info.js"; | ||||
| 
 | ||||
| function createJwksClient(uri: string): jwksClient.JwksClient { | ||||
|     return jwksClient({ | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import { Request } from "express"; | ||||
| import { JwtPayload } from "jsonwebtoken"; | ||||
| import {AuthenticationInfo} from "./authentication-info"; | ||||
| import {AuthenticationInfo} from "./authentication-info.js"; | ||||
| 
 | ||||
| export interface AuthenticatedRequest extends Request { | ||||
|     // Properties are optional since the user is not necessarily authenticated.
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| import cors from "cors"; | ||||
| import {EnvVars, getEnvVar} from "../util/envvars"; | ||||
| import {EnvVars, getEnvVar} from "../util/envvars.js"; | ||||
| 
 | ||||
| export default cors({ | ||||
|     origin: getEnvVar(EnvVars.CorsAllowedOrigins).split(','), | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import express from 'express' | ||||
| import {getFrontendAuthConfig} from "../controllers/auth"; | ||||
| import {authenticatedOnly, studentsOnly, teachersOnly} from "../middleware/auth/auth"; | ||||
| import {getFrontendAuthConfig} from "../controllers/auth.js"; | ||||
| import {authenticatedOnly, studentsOnly, teachersOnly} from "../middleware/auth/auth.js"; | ||||
| const router = express.Router(); | ||||
| 
 | ||||
| // returns auth configuration for frontend
 | ||||
|  |  | |||
		Reference in a new issue