All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lucuma.ui.sso.UserVault.scala Maven / Gradle / Ivy

There is a newer version: 0.123.0
Show newest version
// Copyright (c) 2016-2023 Association of Universities for Research in Astronomy, Inc. (AURA)
// For license information see LICENSE or https://opensource.org/licenses/BSD-3-Clause

package lucuma.ui.sso

import cats.Eq
import cats.derived.*
import eu.timepit.refined.cats.*
import eu.timepit.refined.types.string.NonEmptyString
import lucuma.core.model.User
import monocle.Focus
import org.typelevel.cats.time.instances.instant.*

import java.time.Instant

case class UserVault(user: User, expiration: Instant, token: NonEmptyString) derives Eq:
  lazy val authorizationHeader: String = s"Bearer ${token.value}"

object UserVault:
  val user  = Focus[UserVault](_.user)
  val token = Focus[UserVault](_.token)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy