This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit f9333216 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Doch noch Bugs :-(

parent 4a370d60
2 merge requests!23Next Release Candidate,!22Resolve "Download von Ergebnissen mit Guest User funktioniert mit geschützten Usern nicht mehr"
......@@ -14,6 +14,7 @@ import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
......@@ -25,6 +26,7 @@ import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import at.ac.uibk.gitsearch.config.ApplicationProperties;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtBuilder;
......@@ -88,10 +90,14 @@ public class TokenProvider {
private long tokenValidityInMillisecondsForRememberMe;
@Autowired
private final JHipsterProperties jHipsterProperties;
@Autowired
private final ApplicationProperties applicationProperties;
public TokenProvider(JHipsterProperties jHipsterProperties) {
public TokenProvider(JHipsterProperties jHipsterProperties, ApplicationProperties applicationProperties) {
this.jHipsterProperties = jHipsterProperties;
this.applicationProperties = applicationProperties;
}
@PostConstruct
......@@ -261,7 +267,7 @@ public class TokenProvider {
if(accessToken.isPresent()) {
final Optional<String> accessIssuer = getGitLabAccessIssuer();
if(accessIssuer.isPresent()) {
return Optional.of(new GitLabAccessInfo(accessToken.get(), accessIssuer.get(), getCurrentPrincipal()) );
return Optional.of(new GitLabAccessInfo(accessToken.get(), applicationProperties.getGitLab().getUrl(), getCurrentPrincipal()) );
}
}
return Optional.empty();
......
......@@ -40,7 +40,7 @@ export class SearchService {
}
downloadFile(projectID: string): Observable<Object> {
return this.http.post(SERVER_API_URL + 'download/${projectID}', {
return this.http.post(SERVER_API_URL + 'download/' + projectID, {
observe: 'response',
responseType: 'blob',
});
......
......@@ -39,9 +39,10 @@
</form>
<br/>
<div *ngFor="let config of configs">
<img src="{{'oauth2.'+config.registrationId + '.icon'| translate}}" alt="oAuth2Image"/>
<img src="{{'oauth2.'+config.registrationId + '.icon'| translate}}" alt="oAuth2Image" style="width: 50px;"/>
<button type="submit" class="btn btn-primary" (click)="loginWithGitLab(config.registrationId)" jhiTranslate="oauth2.{{config.registrationId}}.text">Login With GitLab</button>
</div>
<!--
<div class="mt-3 alert alert-warning">
<a class="alert-link" (click)="requestResetPassword()" jhiTranslate="login.password.forgot">Did you forget your password?</a>
</div>
......@@ -50,6 +51,7 @@
<span jhiTranslate="global.messages.info.register.noaccount">You don't have an account yet?</span>
<a class="alert-link" (click)="register()" jhiTranslate="global.messages.info.register.link">Register a new account</a>
</div>
-->
</div>
</div>
</div>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment