Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Where is the restriction access unless youre logged in?


Ive been trying to look for where is it that it is restricting me from accessing the dashboard if im not logged in.

Need to make some mods to it. And adjust to my google login.

Thank you.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

You can find the restriction access code in the file /angular/demo1/src/app/app-routing.module.ts. Within this file, there is a route defined with an AuthGuard that restricts access to the dashboard unless the user is logged in. The specific code snippet looks like this:

{
path: "",
canActivate: [AuthGuard],
loadChildren: () => import("./_metronic/layout/layout.module").then((m) => m.LayoutModule),
},

To make modifications and adjust it to your Google login, you can work with the AuthGuard class, which handles the authentication logic. You can customize the authentication process to suit your specific requirements, such as integrating with Google login.

If you need any further assistance or have specific questions regarding the modifications, feel free to ask.

Thanks



Error Every time I try to use my passport Authguards in the metronic theme from my NestJS backend.

./backend/node_modules/@nestjs/common/utils/load-package.util.js:12:35-55 - Warning: Critical dependency: the request of a dependency is an expression



./backend/node_modules/@nestjs/common/file-stream/streamable-file.js:7:17-34 - Error: Module not found: Error: Can't resolve 'stream' in '/Users/kenflores/Development/InternalApps/radiantDataPortal/RadiantDataApi/backend/node_modules/@nestjs/common/file-stream'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }

./backend/node_modules/@nestjs/common/file-stream/streamable-file.js:8:15-30 - Error: Module not found: Error: Can't resolve 'util' in '/Users/kenflores/Development/InternalApps/radiantDataPortal/RadiantDataApi/backend/node_modules/@nestjs/common/file-stream'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }

./backend/node_modules/@nestjs/common/pipes/validation.pipe.js:10:15-30 - Error: Module not found: Error: Can't resolve 'util' in '/Users/kenflores/Development/InternalApps/radiantDataPortal/RadiantDataApi/backend/node_modules/@nestjs/common/pipes'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }

./backend/node_modules/passport/lib/middleware/authenticate.js:4:11-26 - Error: Module not found: Error: Can't resolve 'http' in '/Users/kenflores/Development/InternalApps/radiantDataPortal/RadiantDataApi/backend/node_modules/passport/lib/middleware'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

./backend/node_modules/passport/lib/strategies/session.js:5:9-24 - Error: Module not found: Error: Can't resolve 'util' in '/Users/kenflores/Development/InternalApps/radiantDataPortal/RadiantDataApi/backend/node_modules/passport/lib/strategies'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }



To better understand the issue you are facing, could you please share the relevant portions of your code? Specifically, we would like to see the parts where you have added passport Authguards and any related configurations.

You can use a code-sharing platform like GitHub Gist and share the link with us.

Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(