Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} from '@nebular/auth';
import { OAuth2LoginComponent } from './oauth2-login.component';
import { OAuth2CallbackComponent } from './oauth2-callback.component';
import { Oauth2RoutingModule } from './oauth2-routing.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
HttpClientModule,
NbAuthModule.forRoot({
strategies: [
NbOAuth2AuthStrategy.setup({
name: 'google',
clientId: '806751403568-03376bvlin9n3rhid0cahus6ei3lc69q.apps.googleusercontent.com',
clientSecret: '',
authorize: {
endpoint: 'https://accounts.google.com/o/oauth2/v2/auth',
responseType: NbOAuth2ResponseType.TOKEN,
scope: 'https://www.googleapis.com/auth/userinfo.profile',
redirectUri: 'https://akveo.github.io/nebular/example/oauth2/callback',
},
redirect: {
success: '/example/oauth2',
},
}),
],
}),
},
requestPass: {
redirect: {
success: '/auth/reset-password',
},
},
resetPass: {
redirect: {
success: '/auth/login',
},
},
errors: {
key: 'data.errors',
},
}),
NbOAuth2AuthStrategy.setup({
name: 'password',
clientId: 'test',
clientSecret: 'secret',
baseEndpoint: 'http://localhost:4400/api/auth/',
token: {
endpoint: 'token',
grantType: NbOAuth2GrantType.PASSWORD,
class: NbAuthOAuth2Token,
},
refresh: {
endpoint: 'refresh-token',
grantType: NbOAuth2GrantType.REFRESH_TOKEN,
},
}),
],
}),
},
]),
NbAuthModule.forRoot({
forms: {
login: {
redirectDelay: 3000,
showMessages : {
error: true,
success: false,
},
strategy: 'password',
},
},
strategies: [
NbOAuth2AuthStrategy.setup({
name: 'password',
clientId: 'Aladdin',
clientSecret: 'open sesame',
clientAuthMethod: NbOAuth2ClientAuthMethod.BASIC,
baseEndpoint: 'http://localhost:4400/api/auth/',
token: {
endpoint: 'token',
grantType: NbOAuth2GrantType.PASSWORD,
class: NbAuthOAuth2JWTToken,
requireValidToken: true,
},
redirect: {
success: '/oauth2-password',
},
}),
],
},
requestPass: {
redirect: {
success: '/auth/reset-password',
},
},
resetPass: {
redirect: {
success: '/auth/login',
},
},
errors: {
key: 'data.errors',
},
}),
NbOAuth2AuthStrategy.setup({
name: 'password',
clientId: 'test',
clientSecret: 'secret',
baseEndpoint: 'http://localhost:4400/api/auth/',
token: {
endpoint: 'token',
grantType: NbOAuth2GrantType.PASSWORD,
class: NbAuthOAuth2Token,
},
refresh: {
endpoint: 'refresh-token',
grantType: NbOAuth2GrantType.REFRESH_TOKEN,
},
}),
],
}),
FormsModule,
HttpClientModule,
NbAuthModule.forRoot({
forms: {
login: {
redirectDelay: 3000,
showMessages : {
error: true,
success: false,
},
strategy: 'password',
},
},
strategies: [
NbOAuth2AuthStrategy.setup({
name: 'password',
clientId: 'Aladdin',
clientSecret: 'open sesame',
clientAuthMethod: NbOAuth2ClientAuthMethod.BASIC,
baseEndpoint: 'http://localhost:4400/api/auth/',
token: {
endpoint: 'token',
grantType: NbOAuth2GrantType.PASSWORD,
class: NbAuthOAuth2JWTToken,
requireValidToken: true,
},
redirect: {
success: '/oauth2-password',
},
}),
],