"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/app/core/auth/auth.service.ts" between
dspace-angular-dspace-7.0.tar.gz and dspace-angular-dspace-7.1.tar.gz

About: dspace-angular is the Angular-based frontend of DSpace, a digital repository system to capture, store, index, preserve and redistribute an organization’s research material in digital formats.

auth.service.ts  (dspace-angular-dspace-7.0):auth.service.ts  (dspace-angular-dspace-7.1)
skipping to change at line 45 skipping to change at line 45
import { AppState } from '../../app.reducer'; import { AppState } from '../../app.reducer';
import { import {
CheckAuthenticationTokenAction, CheckAuthenticationTokenAction,
RefreshTokenAction, RefreshTokenAction,
ResetAuthenticationMessagesAction, ResetAuthenticationMessagesAction,
SetRedirectUrlAction, SetRedirectUrlAction,
SetUserAsIdleAction, SetUserAsIdleAction,
UnsetUserAsIdleAction UnsetUserAsIdleAction
} from './auth.actions'; } from './auth.actions';
import { NativeWindowRef, NativeWindowService } from '../services/window.service '; import { NativeWindowRef, NativeWindowService } from '../services/window.service ';
import { Base64EncodeUrl } from '../../shared/utils/encode-decode.util';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { EPersonDataService } from '../eperson/eperson-data.service'; import { EPersonDataService } from '../eperson/eperson-data.service';
import { getAllSucceededRemoteDataPayload } from '../shared/operators'; import { getAllSucceededRemoteDataPayload } from '../shared/operators';
import { AuthMethod } from './models/auth.method'; import { AuthMethod } from './models/auth.method';
import { HardRedirectService } from '../services/hard-redirect.service'; import { HardRedirectService } from '../services/hard-redirect.service';
import { RemoteData } from '../data/remote-data'; import { RemoteData } from '../data/remote-data';
import { environment } from '../../../environments/environment'; import { environment } from '../../../environments/environment';
import { NotificationsService } from '../../shared/notifications/notifications.s ervice'; import { NotificationsService } from '../../shared/notifications/notifications.s ervice';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
skipping to change at line 106 skipping to change at line 105
/** /**
* Authenticate the user * Authenticate the user
* *
* @param {string} user The user name * @param {string} user The user name
* @param {string} password The user's password * @param {string} password The user's password
* @returns {Observable<User>} The authenticated user observable. * @returns {Observable<User>} The authenticated user observable.
*/ */
public authenticate(user: string, password: string): Observable<AuthStatus> { public authenticate(user: string, password: string): Observable<AuthStatus> {
// Attempt authenticating the user using the supplied credentials. // Attempt authenticating the user using the supplied credentials.
const body = (`password=${Base64EncodeUrl(password)}&user=${Base64EncodeUrl( user)}`); const body = (`password=${encodeURIComponent(password)}&user=${encodeURIComp onent(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', body, options).pipe(
map((rd: RemoteData<AuthStatus>) => { map((rd: RemoteData<AuthStatus>) => {
if (hasValue(rd.payload) && rd.payload.authenticated) { if (hasValue(rd.payload) && rd.payload.authenticated) {
return rd.payload; return rd.payload;
} else { } else {
throw(new Error('Invalid email or password')); throw(new Error('Invalid email or password'));
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)