package net.davidvoid.thor.lightning.service.security;

import java.util.ArrayList;
import java.util.List;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;

public class ThorAuthentication extends AbstractAuthenticationToken {

    private static final long serialVersionUID = -5044029477635986803L;

    private String username = null;
    private long id = -1;

    public ThorAuthentication(String username, long id) {
        super(defaultRoles());
        this.username = username;
        this.id = id;
    }

    private static List<GrantedAuthority> defaultRoles() {
        List<GrantedAuthority> roles = new ArrayList<>();
        roles.add(new SimpleGrantedAuthority("USER"));
        return roles;
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return username;
    }
    
    public long getId() {
        return id;
    }

}

@@ -522,20 +522,22 @@
 private 
-long
+Object
  id = -1
@@ -588,20 +588,22 @@
 ername, 
-long
+Object
  id) %7B%0D%0A
@@ -976,20 +976,18 @@
  return 
-null
+%22%22
 ;%0D%0A    %7D
@@ -1091,20 +1091,22 @@
  public 
-long
+Object
  getId()

change id to object