-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed9d791
commit 7b66494
Showing
4 changed files
with
57 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { getSession } from 'next-auth/react' | ||
import { NextPageContext } from 'next' | ||
import { User } from 'db' | ||
import { isNotDefined } from 'utils' | ||
import { sign } from 'jsonwebtoken' | ||
|
||
const FeedbackPage = () => { | ||
return | ||
} | ||
|
||
export async function getServerSideProps(context: NextPageContext) { | ||
const session = await getSession(context) | ||
if (isNotDefined(session?.user)) | ||
return { | ||
redirect: { | ||
permanent: false, | ||
destination: `/signin?redirectPath=%2Ffeedback`, | ||
}, | ||
} | ||
const sleekplanToken = createSSOToken(session?.user as User) | ||
return { | ||
redirect: { | ||
permanent: false, | ||
destination: `https://feedback.typebot.io?sso=${sleekplanToken}`, | ||
}, | ||
} | ||
} | ||
|
||
const createSSOToken = (user: User) => { | ||
if (!process.env.SLEEKPLAN_SSO_KEY) return | ||
const userData = { | ||
mail: user.email, | ||
id: user.id, | ||
name: user.name, | ||
img: user.image, | ||
} | ||
|
||
return sign(userData, process.env.SLEEKPLAN_SSO_KEY, { algorithm: 'HS256' }) | ||
} | ||
|
||
export default FeedbackPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7b66494
There was a problem hiding this comment.
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:
viewer-v2 – ./apps/viewer
app.yvon.earth
viewer.typebot.io
chat.hayuri.id
bot.contakit.com
zap.fundviser.in
bot.matthesv.de
demo.wemakebots.xyz
88584434.therpm.club
92109660.therpm.club
chat.matthesv.de
criar.somaperuzzo.com
bot.digitalpointer.id
bot.outstandbrand.com
bot.pratikmandalia.com
invite.bridesquadapp.com
link.venturasuceder.com
typebot-viewer.vercel.app
bot.adventureconsulting.hu
chat.thehomebuyersusa.com
chat.atlasoutfittersk9.com
viewer-v2-typebot-io.vercel.app
viewer-v2-git-main-typebot-io.vercel.app
bot.pinpointinteractive.com
tarian.theiofoundation.org
7b66494
There was a problem hiding this comment.
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:
builder-v2 – ./apps/builder
app.typebot.io
builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app