mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 22:43:03 +00:00
post to login endpoint without credentials
This commit is contained in:
@@ -101,7 +101,7 @@ export class AuthInterceptor implements HttpInterceptor {
|
|||||||
const token = authService.getToken();
|
const token = authService.getToken();
|
||||||
let newReq;
|
let newReq;
|
||||||
|
|
||||||
console.log('intercept() request: ', req);
|
// console.log('intercept() request: ', req);
|
||||||
|
|
||||||
if (authService.isTokenExpired()) {
|
if (authService.isTokenExpired()) {
|
||||||
authService.setRedirectUrl(this.router.url);
|
authService.setRedirectUrl(this.router.url);
|
||||||
|
@@ -117,14 +117,14 @@ export class AuthService {
|
|||||||
public startShibbAuth(): Observable<AuthStatus> {
|
public startShibbAuth(): Observable<AuthStatus> {
|
||||||
console.log('startShibAuth() was called');
|
console.log('startShibAuth() was called');
|
||||||
// Attempt authenticating the user using the supplied credentials.
|
// Attempt authenticating the user using the supplied credentials.
|
||||||
const user = 'test@test.at';
|
/* const user = 'test@test.at';
|
||||||
const password = 'rest'
|
const password = 'rest'
|
||||||
const body = (`password=${Base64EncodeUrl(password)}&user=${Base64EncodeUrl(user)}`);
|
const body = (`password=${Base64EncodeUrl(password)}&user=${Base64EncodeUrl(user)}`);
|
||||||
const options: HttpOptions = Object.create({});
|
const options: HttpOptions = Object.create({});*/
|
||||||
let headers = new HttpHeaders();
|
let headers = new HttpHeaders();
|
||||||
headers = headers.append('Content-Type', 'application/x-www-form-urlencoded');
|
headers = headers.append('Content-Type', 'application/x-www-form-urlencoded');
|
||||||
options.headers = headers;
|
// options.headers = headers;
|
||||||
return this.authRequestService.postToEndpoint('login', body, options).pipe(
|
return this.authRequestService.postToEndpoint('login').pipe(
|
||||||
map((status: AuthStatus) => {
|
map((status: AuthStatus) => {
|
||||||
if (status.authenticated) {
|
if (status.authenticated) {
|
||||||
return status;
|
return status;
|
||||||
|
Reference in New Issue
Block a user