You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/ember-simple-auth/src/services/session.ts
+72Lines changed: 72 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,9 @@ export default class SessionService<Data = DefaultDataShape> extends Service {
135
135
{@linkplain SessionService.requireAuthentication}
136
136
If an attempted transition is present it will be retried.
137
137
138
+
This is an `in-memory` property, see {@linkplain SessionService.setRedirectTarget}, {@linkplain SessionService.getRedirectTarget} for a persistent redirect mechanism.
139
+
`attemptedTransition` is used _first_ if set.
140
+
138
141
@memberof SessionService
139
142
@property attemptedTransition
140
143
@type Transition
@@ -144,6 +147,15 @@ export default class SessionService<Data = DefaultDataShape> extends Service {
@@ -238,6 +250,13 @@ export default class SessionService<Data = DefaultDataShape> extends Service {
238
250
will be saved in a `ember_simple_auth-redirectTarget` cookie for use by the
239
251
browser after authentication is complete.
240
252
253
+
Accepts an optional object with `redirectTarget` property. Related to {@linkplain SessionService.setRedirectTarget}, {@linkplain SessionService.getRedirectTarget}
@param {Transition} transition A transition that triggered the authentication requirement or null if the requirement originated independently of a transition
@@ -354,4 +373,57 @@ export default class SessionService<Data = DefaultDataShape> extends Service {
354
373
// If it raises an error then it means that restore didn't find any restorable state.
355
374
});
356
375
}
376
+
377
+
/**
378
+
Stores the `redirectTarget` in both `globalThis.sessionStorage` and the configured `session-store`.
379
+
Key is computed based on the `session-store:application` `key` or `cookieName` property.
380
+
381
+
This method is internally called by {@linkplain SessionService.requireAuthentication}.
0 commit comments