Skip to content

Commit 79347ee

Browse files
committed
pass optional params to silentRefresh
1 parent 85f2dd1 commit 79347ee

File tree

8 files changed

+79
-44
lines changed

8 files changed

+79
-44
lines changed

angular-oauth2-oidc/docs/classes/AuthConfig.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ <h3 id="inputs">
11511151
<td class="col-md-4">
11521152
<div class="io-description"><p>Defines whether https is required.
11531153
The default value is remoteOnly which only allows
1154-
http for location, while every other domains need
1154+
http for localhost, while every other domains need
11551155
to be used with https.</p>
11561156
</div>
11571157
</td>
@@ -1880,7 +1880,7 @@ <h3 id="inputs">
18801880
/**
18811881
* Defines whether https is required.
18821882
* The default value is remoteOnly which only allows
1883-
* http for location, while every other domains need
1883+
* http for localhost, while every other domains need
18841884
* to be used with https.
18851885
*/
18861886
public requireHttps?: boolean | &#x27;remoteOnly&#x27; &#x3D; &#x27;remoteOnly&#x27;;

angular-oauth2-oidc/docs/injectables/OAuthService.html

Lines changed: 62 additions & 32 deletions
Large diffs are not rendered by default.

angular-oauth2-oidc/docs/js/search/search_index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular-oauth2-oidc/docs/modules/OAuthModule.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ <h3>File</h3>
556556

557557
@NgModule({
558558
imports: [
559-
CommonModule
559+
CommonModule,
560+
//HttpModule
560561
],
561562
declarations: [
562563
],

angular-oauth2-oidc/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export * from './tokens';
2626
@NgModule({
2727
imports: [
2828
CommonModule,
29-
HttpModule
29+
//HttpModule
3030
],
3131
declarations: [
3232
],

angular-oauth2-oidc/src/oauth-service.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,16 @@ export class OAuthService
135135
});
136136
}
137137

138-
public setupAutomaticSilentRefresh() {
138+
/**
139+
*
140+
* @param params Additional parameter to pass
141+
*/
142+
public setupAutomaticSilentRefresh(params: object = {}) {
139143
this
140144
.events
141145
.filter(e => e.type === 'token_expires')
142146
.subscribe(e => {
143-
this.silentRefresh().catch(_ => {
147+
this.silentRefresh(params).catch(_ => {
144148
this.debug('automatic silent refresh did not work');
145149
})
146150
});
@@ -652,7 +656,7 @@ export class OAuthService
652656
* Use this method to get a new tokens when/ before
653657
* the existing tokens expires.
654658
*/
655-
public silentRefresh(): Promise<OAuthEvent> {
659+
public silentRefresh(params: object = {}): Promise<OAuthEvent> {
656660

657661
let claims = this.getIdentityClaims();
658662

@@ -679,7 +683,7 @@ export class OAuthService
679683
this.setupSilentRefreshEventListener();
680684

681685
let redirectUri = this.silentRefreshRedirectUri || this.redirectUri;
682-
this.createLoginUrl(null, null, redirectUri, true).then(url => {
686+
this.createLoginUrl(null, null, redirectUri, true, params).then(url => {
683687
iframe.setAttribute('src', url);
684688
if (!this.silentRefreshShowIFrame) {
685689
iframe.style.visibility = 'hidden';

angular-oauth2-oidc/src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-oauth2-oidc",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/manfredsteyer/angular-oauth2-oidc"

sample/src/app/home/home.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class HomeComponent implements OnInit {
2222

2323

2424
login() {
25-
this.oauthService.initImplicitFlow('http://www.myurl.com/x/y/z', { x: 1 });
25+
this.oauthService.initImplicitFlow('some-state', { 'custom-param': 'test' });
2626
}
2727

2828
logout() {

0 commit comments

Comments
 (0)