Do not verify token during tests

This commit is contained in:
Niklas Fondberg
2021-07-06 12:25:38 +02:00
parent 4b7133a9ab
commit 6bca11c62d
7 changed files with 1962 additions and 13207 deletions
+4
View File
@@ -28,6 +28,10 @@ const dataSources = () => ({
});
const context = async ({ req }) => {
if (process.env.NODE_ENV == 'test') {
return { auth: 'testuser' };
}
const authHeader = req.headers.authorization || '';
if (authHeader.startsWith('Bearer ')) {
const token = authHeader.substring(7, authHeader.length);