Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server side authentication #475

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Server side authentication #475

wants to merge 13 commits into from

Conversation

FluidSense
Copy link
Contributor

@FluidSense FluidSense commented Sep 27, 2020

Change from oidc-client to next-auth to allow for server side rendering.
This is motivated by a change coming to browsers which disallow iframe renewal of tokens, and as such users will be logged out often.
By using Next as a backend-for-frontend, Next can keep renew tokens and keep secrets, allowing for safe renewal of tokens through other flows than PKCE.

To-do before undraft:

  • Fix types on pages/api/auth
  • Fix types on useSession()'s returned user so that it can share a type with the one actually in use at pages/api/auth and not need (session.user as unknown as IAuthUser).profile. this to cast it every time it is needed.
  • Renew access tokens on expiration

@vercel
Copy link

vercel bot commented Sep 27, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/dotkom/onlineweb-frontend/5r51t4p54
✅ Preview: https://onlineweb-frontend-git-fix-server-side-auth.dotkom.vercel.app

@balazsorban44
Copy link

NextAuth.js maintainer her! Gi meg en pip hvis dere trenger hjelp med dette. 😉

Mye som har endret seg siden 3.1.0, vi har en v4 beta nå også (https://next-auth.js.org/getting-started/upgrade-v4)!

Innebygd TypeScript, bedre docs, enklere/mer logiske signaturer, osv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants