added login logic excl refresh call
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.vaessl.app.connection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
import com.vaessl.app.dto.ConnectionRequest;
|
||||
import com.vaessl.app.dto.ConnectionResponse;
|
||||
|
||||
import jakarta.persistence.DiscriminatorValue;
|
||||
import jakarta.persistence.Entity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@DiscriminatorValue("HOMEBOX")
|
||||
@Getter
|
||||
@Setter
|
||||
public class HomeboxEntity extends ConnectionEntity {
|
||||
|
||||
private String token;
|
||||
private String attachmentToken;
|
||||
private Instant expiresAt;
|
||||
|
||||
public static HomeboxEntity from(ConnectionRequest request, ConnectionResponse response) {
|
||||
|
||||
HomeboxEntity he = new HomeboxEntity();
|
||||
|
||||
he.setAppUrl(request.appUrl());
|
||||
he.setToken(response.token());
|
||||
he.setAttachmentToken(response.getExtraVar("attachmentToken"));
|
||||
he.setExpiresAt(response.expiresAt());
|
||||
|
||||
return he;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user