(database: &Database)
| 664 | } |
| 665 | |
| 666 | pub async fn is_idc_user(database: &Database) -> Result<bool> { |
| 667 | if cfg!(test) { |
| 668 | return Ok(false); |
| 669 | } |
| 670 | if let Ok(Some(token)) = BuilderIdToken::load(database, None).await { |
| 671 | Ok(token.token_type() == TokenType::IamIdentityCenter) |
| 672 | } else { |
| 673 | Err(eyre!("No auth token found - is the user signed in?")) |
| 674 | } |
| 675 | } |
| 676 | |
| 677 | #[cfg(test)] |
| 678 | mod tests { |
no test coverage detected