You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i am trying to use your package for making steam auth in my Nest JS project
After 3-5 days working, i wasnt able to find any decision
I am not getting any error, but also i am not able to force my app to redirect to steam auth page, my code places here https://github.com/ipirm/steam-nest
I folowed your example and changed my /src/main.ts and /src/auth/auth.controller.ts , but it is not working now
My STEAM_API_KEY is work, i used it in your example to make it work
My main.ts file:
import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { join } from 'path';
import { AppModule } from './app.module';
import * as session from 'express-session'
const SteamStrategy = require('passport-steam').Strategy;
import * as passport from "passport";
passport.use(new SteamStrategy({
returnURL: 'http://localhost:3000/auth/steam/return',
realm: 'http://localhost:3000/',
apiKey: 'D30D8318F7565B58C561E689F2210B87'
},
function(identifier, profile, done) {
// asynchronous verification, for effect...
process.nextTick(function () {
// To keep the example simple, the user's Steam profile is returned to
// represent the logged-in user. In a typical application, you would want
// to associate the Steam account with a user record in your database,
// and return that user instead.
profile.identifier = identifier;
return done(null, profile);
})}));
// Initialize Passport! Also use passport.session() middleware, to support
// persistent login sessions (recommended).
app.use(passport.initialize());
app.use(passport.session());
Hi, i am trying to use your package for making steam auth in my Nest JS project
After 3-5 days working, i wasnt able to find any decision
I am not getting any error, but also i am not able to force my app to redirect to steam auth page, my code places here
https://github.com/ipirm/steam-nest
I folowed your example and changed my /src/main.ts and /src/auth/auth.controller.ts , but it is not working now
My STEAM_API_KEY is work, i used it in your example to make it work
My main.ts file:
import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { join } from 'path';
import { AppModule } from './app.module';
import * as session from 'express-session'
const SteamStrategy = require('passport-steam').Strategy;
import * as passport from "passport";
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(obj, done) {
done(null, obj);
});
passport.use(new SteamStrategy({
returnURL: 'http://localhost:3000/auth/steam/return',
realm: 'http://localhost:3000/',
apiKey: 'D30D8318F7565B58C561E689F2210B87'
},
function(identifier, profile, done) {
// asynchronous verification, for effect...
process.nextTick(function () {
// To keep the example simple, the user's Steam profile is returned to
// represent the logged-in user. In a typical application, you would want
// to associate the Steam account with a user record in your database,
// and return that user instead.
profile.identifier = identifier;
return done(null, profile);
})}));
async function bootstrap() {
const app = await NestFactory.create(
AppModule,
);
// Initialize Passport! Also use passport.session() middleware, to support
// persistent login sessions (recommended).
app.use(passport.initialize());
app.use(passport.session());
app.useStaticAssets(join(__dirname, '..', 'public'));
app.setBaseViewsDir(join(__dirname, '..', 'views'));
app.setViewEngine('hbs');
await app.listen(3000);
}
bootstrap();
And my controller:
import {Controller, Get,Res} from '@nestjs/common';
import * as passport from 'passport'
@controller('auth')
export class AuthController {
constructor() {}
}
Maybe you can help me 😇
The text was updated successfully, but these errors were encountered: