mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 20:43:08 +00:00
Merge branch 'master' into language-header
This commit is contained in:
@@ -279,18 +279,6 @@ export class AuthService {
|
||||
return observableOf(authMethods);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user
|
||||
* @returns {User}
|
||||
*/
|
||||
public create(user: EPerson): Observable<EPerson> {
|
||||
// Normally you would do an HTTP request to POST the user
|
||||
// details and then return the new user object
|
||||
// but, let's just return the new user for this example.
|
||||
// this._authenticated = true;
|
||||
return observableOf(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* End session
|
||||
* @returns {Observable<boolean>}
|
||||
@@ -555,4 +543,14 @@ export class AuthService {
|
||||
return this.getImpersonateID() === epersonId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a short-lived token for appending to download urls of restricted files
|
||||
* Returns null if the user isn't authenticated
|
||||
*/
|
||||
getShortlivedToken(): Observable<string> {
|
||||
return this.isAuthenticated().pipe(
|
||||
switchMap((authenticated) => authenticated ? this.authRequestService.getShortlivedToken() : observableOf(null))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user