DescopeSession constructor

DescopeSession(
  1. DescopeToken sessionToken,
  2. DescopeToken refreshToken,
  3. DescopeUser user
)

Creates a new DescopeSession object from tokens.

Implementation

factory DescopeSession(DescopeToken sessionToken, DescopeToken refreshToken, DescopeUser user) {
  // for web only - refresh token might be available via cookie only
  if (sessionToken.jwt == refreshToken.jwt) {
    refreshToken = WebRefreshToken(sessionToken);
  }
  return DescopeSession._internal(sessionToken, refreshToken, user);
}