Comments (24)
any update on any documentation with examples of using an external auth provider such as auth0
from nebular.
based on the current version of nebular , you just need to import the library
import {NbThemeModule, NbLayoutModule, NbSidebarModule, NbButtonModule, NbMenuModule, NbSidebarService} from '@nebular/theme';
and then add the "NbSidebarService" to your provider :
providers: [NbSidebarService],
it should be working
from nebular.
@wilson-young have you resolved the issue? Please provide a complete description with code examples and steps. Thanks.
from nebular.
Hey Guys, we updated the Auth section of the documentation. Please read through the articles here https://akveo.github.io/nebular/#/docs/auth/introduction, hope this would be helpful!
from nebular.
Hi @manojvs, @thovo, there is no need to copy ALL sources to modify components templates. Just copy the components, change the references to the services and providers to be still imported from the Nebular and that's it. Otherwise, you end up not being able to update your code to a newer version of Nebular, as you will need to merge every file one by one.
from nebular.
And I currently also stopped at this error: Error: No provider for NbAuthService!
from nebular.
Okay, after moving around, it worked for me now, I can now customize the all auth part as I wish.
Ironically, when I followed the tutorial, it just leaded me to new errors.
- So to be simple, you need to copy all the source files, include also services, providers and etc.
- Add these lines in
app.module.ts
import { NbAuthModule } from './@theme/components/auth/auth.module';
import { NbEmailPassAuthProvider } from './@theme/components/auth/providers/email-pass-auth.provider';
NbAuthModule.forRoot({
providers: {
email: {
service: NbEmailPassAuthProvider,
config: {},
}
}
})
- Compile again, stop the terminal first and restart it. Go to login component or any component you want, modify some text to see if it works.
- If it works as expected, drink wine
- Else, use hammer when deal with your boss
from nebular.
@wilson-young @nnixaa it work correctly but when I build using ng build --prod it gets components from node modules
from nebular.
in auth.component.ts i add a providers: [NbAuthService]
is it the correct way? but now the error change to core.es5.js:1020 ERROR Error: Uncaught (in promise): Error: No provider for NbTokenService!
from nebular.
@nnixaa,
Currently I have copied /framework/auth directory to my project src/app directory.
From the issue #12, u have said
In your particular case make sure that your app.routes correctly linked with your copied auth components, plus, as you copied them you have to tell Angular about that - so you need import them in some of your Angular modules (depending on your project structure). Hope this helps.
so i imported auth module into my app module
and i changed the import part in app-routing.module.ts
i also tried the add code in app.module as i see in documentation:
but i get the error nbEmailPassAuthProvider not found
i think my problem is i have done a wrong way to connect a custom auth directory into my ngx-admin project. can u help me with the best practice step for this issue? for customize auth module.
from nebular.
currently i get error when i try to access #/auth/login.
from nebular.
@wilson-young so as from the error - please import NbEmailPassAuthProvider in the app module and register it in providers section.
from nebular.
Thanks @nnixaa for respond, when i import
it will trigger error :
Can't export value NbEmailPassAuthProvider from NbAuthModule as it was neither declared nor imported!
note: can we have a more detail documentation about this case? about how to customize auth component, changing default register layout (because i think i need more user information in sign up page).
sorry for brothering you.
Thanks
from nebular.
@wilson-young we definitely will. So far it's hard to tell what's causing your issue. Generally, there is nothing special in the auth module - just a bunch of services and components. You can deploy a reproducible example to https://plnkr.co so that we can take a look.
from nebular.
i cannot upload nebular auth module and ngx-admin to plunker,
so i attached the zip of my app directory.
from nebular.
@wilson-young have you sort out the issue ???
from nebular.
@naumanahmad17, no I haven't, I temporary using my own auth module.
from nebular.
@wilson-young thanks for the replay :). i am also going that way :)
from nebular.
@nnixaa, thanks for the update, i will try with new project later. thanks
from nebular.
@wilson-young can you do it now?
I followed the tutorial and just found out that I couldn't include just only source, when compiled, the compiler said I was missing a service inside auth.component
so I copied the whole source include service
. It worked but it didn't recognize router-outlet
so I did added RouterModule
into theme.module.ts
. @nnixaa I think you may need to update the tutorial or I did something wrong.
from nebular.
An extension of the suggestion from @thovo - copying all source files from https://github.com/akveo/nebular/tree/master/src/framework/auth to 'theme/components/auth'
core.module.ts
import { NbAuthModule, NbDummyAuthProvider } from '../@theme/components/auth'; // '@nebular/auth';
app-routing.module.ts
import {
NbAuthComponent,
NbLoginComponent,
NbLogoutComponent,
NbRegisterComponent,
NbRequestPasswordComponent,
NbResetPasswordComponent,
} from './@theme/components/auth'; //'@nebular/auth';
theme.module.ts (instead of app.module.ts)
import { NbAuthModule } from './components/auth/auth.module';
import { NbEmailPassAuthProvider } from './components/auth/providers/email-pass-auth.provider';
NbAuthModule.forRoot({
providers: {
email: {
service: NbEmailPassAuthProvider,
config: {},
}
}
}).providers,
from nebular.
Closing this one as the conversation is out of the initial topic.
from nebular.
I was trying to integrate firebase registration with nebular. How can I do this? any example?
from nebular.
An extension of the suggestion from @thovo - copying all source files from https://github.com/akveo/nebular/tree/master/src/framework/auth to 'theme/components/auth'
core.module.ts
import { NbAuthModule, NbDummyAuthProvider } from '../@theme/components/auth'; // '@nebular/auth';
app-routing.module.ts
import { NbAuthComponent, NbLoginComponent, NbLogoutComponent, NbRegisterComponent, NbRequestPasswordComponent, NbResetPasswordComponent, } from './@theme/components/auth'; //'@nebular/auth';
theme.module.ts (instead of app.module.ts)
import { NbAuthModule } from './components/auth/auth.module'; import { NbEmailPassAuthProvider } from './components/auth/providers/email-pass-auth.provider';
NbAuthModule.forRoot({ providers: { email: { service: NbEmailPassAuthProvider, config: {}, } } }).providers,
that is the right answer but you should do it according to the change list in in this address
from nebular.
Related Issues (20)
- caught error defaultview
- error handling when serve the project(ng serve) I'm using angular 12th version
- logout
- logout
- pipe table
- Theme is not a map.
- Could not read Angular module file: /src/null.ts (Standalone) or /src/[object Object].ts (ng modules) HOT 6
- Docs: latest version 9.0.0 but appear to have version 13 installed HOT 2
- NbTreeGrid Error NullInjectorError: No provider for InjectionToken CDK_TABLE! HOT 14
- RangePicker only Month and Year
- Request for Multiline Input Support in <nb-chat-from> Component
- angular/[email protected]: [ERROR] TS2610 in NbTable HOT 11
- Same issue with Angular 17
- When I open an NbDialog first and then open an NbWindow, the window will be displayed behind the dialog. How can I resolve this issue?
- When I tried to open a dialog, the following exception occurred.
- customized login style HOT 1
- Microfrontend problem : does not provide an export named 'icons' (at _nebular_eva_icons-13_0_0-dev.js:24:10)
- NullInjectorError when using NbChatModule in Angular 17 with Nebular 13 (standalone components angular) HOT 1
- Support for Angular 18
- `NbDialogService` has problem with `inputSignal` and `ModelSignal`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nebular.