mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-24 14:24:47 +08:00
fix auth header formatting issue
This commit is contained in:
parent
b833bc0f0d
commit
8b07f24e48
@ -17,7 +17,7 @@ export class API {
|
||||
contentType: isFormData ? false : 'application/json',
|
||||
data: isBodyRequest && !isFormData ? JSON.stringify(data) : data,
|
||||
processData: !(isFormData || isBodyRequest),
|
||||
headers: {'Authorization': 'HangarApi session=' + session}
|
||||
headers: {'Authorization': 'HangarApi session="' + session + '"'}
|
||||
}).done((data) => {
|
||||
resolve(data);
|
||||
}).fail((xhr) => {
|
||||
|
@ -48,13 +48,12 @@ public class AuthenticationService {
|
||||
private final AuthenticationManager authenticationManager;
|
||||
private final RoleService roleService;
|
||||
private final PermissionService permissionService;
|
||||
private final SsoService ssoService;
|
||||
|
||||
private static final String UUID_REGEX = "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}";
|
||||
private static final String UUID_REGEX = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
||||
private static final Pattern API_KEY_PATTERN = Pattern.compile("(" + UUID_REGEX + ").(" + UUID_REGEX + ")");
|
||||
|
||||
@Autowired
|
||||
public AuthenticationService(HttpServletRequest request, ApiAuthInfo apiAuthInfo, HangarConfig hangarConfig, HangarDao<UserDao> userDao, HangarDao<SessionsDao> sessionsDao, HangarDao<ApiKeyDao> apiKeyDao, AuthenticationManager authenticationManager, RoleService roleService, PermissionService permissionService, SsoService ssoService) {
|
||||
public AuthenticationService(HttpServletRequest request, ApiAuthInfo apiAuthInfo, HangarConfig hangarConfig, HangarDao<UserDao> userDao, HangarDao<SessionsDao> sessionsDao, HangarDao<ApiKeyDao> apiKeyDao, AuthenticationManager authenticationManager, RoleService roleService, PermissionService permissionService) {
|
||||
this.request = request;
|
||||
this.apiAuthInfo = apiAuthInfo;
|
||||
this.hangarConfig = hangarConfig;
|
||||
@ -64,7 +63,6 @@ public class AuthenticationService {
|
||||
this.authenticationManager = authenticationManager;
|
||||
this.roleService = roleService;
|
||||
this.permissionService = permissionService;
|
||||
this.ssoService = ssoService;
|
||||
}
|
||||
|
||||
public ApiAuthInfo getApiAuthInfo(String token) {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.minidigger.hangar.util;
|
||||
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
Loading…
Reference in New Issue
Block a user