File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
server/src/main/java/org/eclipse/openvsx Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 3232import org .eclipse .openvsx .storage .StorageUtilService ;
3333import org .eclipse .openvsx .util .*;
3434import org .springframework .beans .factory .annotation .Autowired ;
35+ import org .springframework .beans .factory .annotation .Value ;
3536import org .springframework .cache .annotation .CacheEvict ;
3637import org .springframework .security .core .context .SecurityContextHolder ;
3738import org .springframework .security .oauth2 .client .registration .ClientRegistrationRepository ;
@@ -58,6 +59,9 @@ public class UserService {
5859 private final ClientRegistrationRepository clientRegistrationRepository ;
5960 private final OAuth2AttributesConfig attributesConfig ;
6061
62+ @ Value ("${ovsx.token-prefix:}" )
63+ String tokenPrefix ;
64+
6165 public UserService (
6266 EntityManager entityManager ,
6367 RepositoryService repositories ,
@@ -101,7 +105,7 @@ public PersonalAccessToken useAccessToken(String tokenValue) {
101105 public String generateTokenValue () {
102106 String value ;
103107 do {
104- value = UUID .randomUUID (). toString ();
108+ value = tokenPrefix + UUID .randomUUID ();
105109 } while (repositories .hasAccessToken (value ));
106110 return value ;
107111 }
You can’t perform that action at this time.
0 commit comments