0

I'm using railwayjs for my new project, which uses passport framework for authentication. In the environment.js file, i'm requireing and configuring the passport details. I've a controller auth which does the login. So inside an action in auth controller i need to access the same passport variable i've used in environment.js. how do i do that? am i missing something?

shahalpk
  • 3,383
  • 7
  • 36
  • 55

1 Answers1

0

You can simply create a global, though, railwayjs specific alternative may exist.

// environment.js
global.Auth = {user: "123"};


// Another file;
console.log(Auth); // {user: "123};
Daniel
  • 1,692
  • 2
  • 13
  • 19