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
Missing Blitz sessionMiddleware when trying to use passport-twitch-strategy #394
Comments
Hi @Kiodok!
|
Hello @beerose :) Thanks for your help so far 👍 |
hey @Kiodok, I was trying to reproduce it and |
Hey @beerose :D blitz.config.ts: import { BlitzConfig, sessionMiddleware, simpleRolesIsAuthorized } from "blitz"
const config: BlitzConfig = {
middleware: [
sessionMiddleware({
cookiePrefix: "streamconnect",
isAuthorized: simpleRolesIsAuthorized,
}),
],
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
module.exports = {
distDir: "build",
};
return config
},
}
module.exports = config |
Hello @beerose :) Greetings, |
Hey @Kiodok — could you try using
|
Hello @beerose, <a href="/api/auth/twitch">
<SignUpInButton color="deepPurple">Twitch</SignUpInButton>
</a> |
Ok, I tried it again, and this time I used your blitz.config.ts. You overode the config (with the second
|
Thanks @beerose, that really helped and did the trick so far. 14:02:51.173 INFO Starting authentication via twitch...
I already searched for the module serverless\blitz-db.js, but couldn't find anything. |
Sorry about the late reply. The code that looks for |
@beerose No problem. |
Hmm, that should be generated out of the box when you run |
@beerose I reinstalled everything and ran both commands - same error. import { BlitzConfig, sessionMiddleware, simpleRolesIsAuthorized } from "blitz"
const config: BlitzConfig = {
middleware: [
sessionMiddleware({
cookiePrefix: "streamconnect",
isAuthorized: simpleRolesIsAuthorized,
}),
],
distDir: "build",
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
return config
},
}
module.exports = config |
Ah okay. So since you have |
@beerose I removed the distDir and now I get the following error: API resolved without sending a response for /api/auth/twitch/callback?code=vtxuqhnsgtbb153vabw99t1765xtms&scope=user%3Aread%3Aemail, this may result in stalled requests. { Unknown arg
clientVersion: '3.1.1' What do you think about this? |
@beerose It's working now! :D |
Awesome, @Kiodok!
Do you mean in the strategy callback? |
Yes, exactly. |
ok, thanks! |
What is the problem?
I'd like to include twitch login for my blitz application. I created a Button in the login form with a router.push to the route "/api/auth/twitch".
After that I was able to login through twitch and authorize my app.
I already tried the passport-twitch package, but found out that it is a bit outdated, last update years ago.
So I switched to passport-twitch-strategy, which is just a few months old.
Now I'm stuck at the error shown below.
Thank you in advance for your assistance.
Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
The text was updated successfully, but these errors were encountered: