unilim-cas 1.0.1

A purrfect CAS authentication wrapper for Unilim.
Documentation
use crate::native;
use wasm_bindgen::prelude::*;

/// oauth2 client configuration.
#[wasm_bindgen]
pub struct OAuth2 {
    pub(super) inner: native::OAuth2,
}

#[wasm_bindgen]
impl OAuth2 {
    #[wasm_bindgen(constructor)]
    pub fn new(identifier: String, callback: String, scopes: Vec<String>) -> OAuth2 {
        OAuth2 {
            inner: native::OAuth2::new(identifier, callback, scopes),
        }
    }

    #[wasm_bindgen(getter)]
    pub fn identifier(&self) -> String {
        self.inner.identifier.clone()
    }

    #[wasm_bindgen(getter)]
    pub fn callback(&self) -> String {
        self.inner.callback.clone()
    }

    #[wasm_bindgen(getter)]
    pub fn scopes(&self) -> Vec<String> {
        self.inner.scopes.clone()
    }
}