Merge branch 'master' into language-header

This commit is contained in:
ddinuzzo
2020-07-02 14:51:17 +02:00
committed by GitHub
72 changed files with 2411 additions and 410 deletions

View File

@@ -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))
);
}
}