Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Release/4.3.0 (#165)
Browse files Browse the repository at this point in the history
* chore: update deps
* feat: add e2e tests
  • Loading branch information
schwamic authored May 2, 2021
1 parent 5b20b99 commit 2f825cb
Show file tree
Hide file tree
Showing 16 changed files with 272 additions and 156 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.fontFamily": "Monoflow, Menlo, Monaco, 'Courier New', monospace",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"yarn": "~1.22"
},
"dependencies": {
"@fontsource/barlow": "4.2.2",
"@reach/combobox": "0.15.1",
"@reach/dialog": "0.15.0",
"@reach/tabs": "0.15.0",
"auth0-js": "9.16.0",
"classnames": "2.3.1",
"compressorjs": "1.0.7",
"fontsource-barlow": "4.0.0",
"formik": "2.2.6",
"framer-motion": "4.1.11",
"lodash": "4.17.21",
Expand Down Expand Up @@ -74,7 +74,7 @@
"postcss": "8.2.13",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-import": "14.0.1",
"postcss-nesting": "7.0.1",
"postcss-nesting": "8.0.1",
"postcss-preset-env": "6.7.0",
"prettier": "2.2.1",
"stylelint": "13.13.1",
Expand Down
2 changes: 1 addition & 1 deletion projects/auth-login/src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/prop-types */
import Head from 'next/head'
import 'fontsource-barlow/latin.css'
import '@fontsource/barlow/latin.css'
import 'ui-library/styles/tailwind.css'
import { ToastsProvider } from 'ui-library/services/Toasts.service'

Expand Down
2 changes: 1 addition & 1 deletion projects/auth-password/src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/prop-types */
import Head from 'next/head'
import 'fontsource-barlow/latin.css'
import '@fontsource/barlow/latin.css'
import 'ui-library/styles/tailwind.css'
import { ToastsProvider } from 'ui-library/services/Toasts.service'

Expand Down
2 changes: 1 addition & 1 deletion projects/e2e/cypress/integration/main.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Cypress.Cookies.defaults({
preserve: ['a0:state', 'a0:session'],
preserve: ['a0:state', 'a0:session', 'appSession'],
})

import './_landingpage.spec'
Expand Down
2 changes: 1 addition & 1 deletion projects/ui-library/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'fontsource-barlow/latin.css'
import '@fontsource/barlow/latin.css'
import '../styles/tailwind.css'

export const parameters = {
Expand Down
4 changes: 2 additions & 2 deletions projects/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@apollo/client": "3.3.16",
"@auth0/nextjs-auth0": "0.16.0",
"@auth0/nextjs-auth0": "1.3.0",
"@sendgrid/client": "7.4.2",
"@sendgrid/mail": "7.4.2",
"auth0": "2.34.2",
Expand All @@ -27,7 +27,7 @@
"graphql-tag": "2.12.4",
"jsonwebtoken": "8.5.1",
"meilisearch": "0.18.2",
"sitemap": "6.4.0"
"sitemap": "7.0.0"
},
"devDependencies": {
"babel-plugin-graphql-tag": "3.2.0"
Expand Down
2 changes: 1 addition & 1 deletion projects/webapp/src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ApolloProvider } from '@apollo/client'
import { Provider as ReakitProvider } from 'reakit'
import Head from 'next/head'
import smoothscroll from 'smoothscroll-polyfill'
import 'fontsource-barlow/latin.css'
import '@fontsource/barlow/latin.css'

import 'ui-library/styles/tailwind.css'
import { LoadingIndicator } from 'ui-library/stories/atoms'
Expand Down
2 changes: 1 addition & 1 deletion projects/webapp/src/pages/api/callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { handleError } from '../../utils/functions/api.function'

export default async function callback(req, res) {
try {
await auth0.handleCallback(req, res, { redirectTo: '/user/projects' })
await auth0.handleCallback(req, res)
} catch (error) {
handleError({ res, error })
}
Expand Down
2 changes: 1 addition & 1 deletion projects/webapp/src/pages/api/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { handleError } from '../../utils/functions/api.function'

export default async function login(req, res) {
try {
await auth0.handleLogin(req, res)
await auth0.handleLogin(req, res, { returnTo: '/user/projects' })
} catch (error) {
handleError({ res, error })
}
Expand Down
3 changes: 1 addition & 2 deletions projects/webapp/src/pages/api/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { handleError } from '../../utils/functions/api.function'

export default async function session(req, res) {
try {
const tokenCache = auth0.tokenCache(req, res)
const { accessToken } = await tokenCache.getAccessToken()
const { accessToken } = await auth0.getAccessToken(req, res)
res.status(200).json({ accessToken })
} catch (error) {
handleError({ res, error })
Expand Down
2 changes: 1 addition & 1 deletion projects/webapp/src/pages/api/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import auth0 from '../../utils/libs/auth0'
import runMiddleware, { rateLimiter } from '../../utils/functions/runMiddleware.function'
import { handleError } from '../../utils/functions/api.function'

export default auth0.requireAuthentication(async function upload(req, res) {
export default auth0.withApiAuthRequired(async function upload(req, res) {
try {
await runMiddleware(req, res, rateLimiter)
const { id, picture } = req.body
Expand Down
2 changes: 1 addition & 1 deletion projects/webapp/src/pages/projects/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export async function getServerSideProps(ctx) {
} else {
let userId = 'anonymous'
try {
const session = await auth0.getSession(ctx.req)
const session = await auth0.getSession(ctx.req, ctx.res)
if (session?.user) {
userId = session.user.sub
}
Expand Down
10 changes: 5 additions & 5 deletions projects/webapp/src/utils/libs/apolloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const requestAccessTokenClient = async () => {
}
}

const requestAccessTokenServer = async req => {
const requestAccessTokenServer = async (req, res) => {
if (typeof req === 'undefined') {
accessToken = 'public'
}
const res = await auth0.getSession(req)
if (!res?.accessToken) {
const session = await auth0.getSession(req, res)
if (!session?.accessToken) {
accessToken = 'public'
} else {
accessToken = res.accessToken
accessToken = session.accessToken
}
}

Expand All @@ -40,7 +40,7 @@ const httpLink = new HttpLink({
const authLink = ctx =>
setContext(async (req, { headers }) => {
if (typeof window === 'undefined') {
await requestAccessTokenServer(ctx.req)
await requestAccessTokenServer(ctx.req, ctx.res)
} else {
await requestAccessTokenClient()
}
Expand Down
25 changes: 14 additions & 11 deletions projects/webapp/src/utils/libs/auth0.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { initAuth0 } from '@auth0/nextjs-auth0'

export default initAuth0({
audience: process.env.AUTH0_AUDIENCE,
clientId: process.env.AUTH0_CLIENT_ID,
issuerBaseURL: `https://${process.env.AUTH0_DOMAIN}`,
clientID: process.env.AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
scope: process.env.AUTH0_SCOPE,
domain: process.env.AUTH0_DOMAIN,
redirectUri: process.env.AUTH0_REDIRECT_URI,
postLogoutRedirectUri: process.env.AUTH0_POST_LOGOUT_REDIRECT_URI,
secret: process.env.AUTH0_SESSION_COOKIE_SECRET,
clockTolerance: 60,
baseURL: process.env.DOMAIN,
routes: {
callback: '/api/callback',
postLogoutRedirect: '/',
},
authorizationParams: {
audience: process.env.AUTH0_AUDIENCE,
scope: process.env.AUTH0_SCOPE,
},
session: {
cookieSecret: process.env.AUTH0_SESSION_COOKIE_SECRET,
cookieLifetime: 60 * 60 * 8,
storeAccessToken: true,
storeRefreshToken: true,
storeIdToken: false,
rollingDuration: 60 * 60 * 8,
},
})
Loading

3 comments on commit 2f825cb

@vercel
Copy link

@vercel vercel bot commented on 2f825cb May 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web-nusszopf – ./projects/webapp

web-nusszopf-git-master-nusszopf.vercel.app
web-nusszopf-nusszopf.vercel.app
www.nusszopf.org
nusszopf.org

@vercel
Copy link

@vercel vercel bot commented on 2f825cb May 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

auth-login-nusszopf – ./projects/auth-login

auth-login-nusszopf-git-master-nusszopf.vercel.app
auth.login.nusszopf.org
auth-login-nusszopf-nusszopf.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 2f825cb May 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

auth-password-nusszopf – ./projects/auth-password

auth-password-nusszopf-git-master-nusszopf.vercel.app
auth.password.nusszopf.org
auth-password-nusszopf-nusszopf.vercel.app

Please sign in to comment.