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

typescript-aurelia.AuthStorage.ts.mustache Maven / Gradle / Ivy

There is a newer version: 3.0.0-rc1
Show newest version
{{>licenseInfo}}
/**
 * Class to storage authentication data
 */
export class AuthStorage {
  private storage: Map;

  constructor() {
    this.storage = new Map();
  }
{{#authMethods}}

  /**
   * Sets the {{name}} auth method value.
   *
   * @param value The new value to set for {{name}}.
   */
  set{{name}}(value: string): this {
    this.storage.set('{{name}}', value);
    return this;
  }

  /**
   * Removes the {{name}} auth method value.
   */
  remove{{name}}(): this {
    this.storage.delete('{{name}}');
    return this;
  }

  /**
   * Gets the {{name}} auth method value.
   */
  get{{name}}(): null | string {
    return this.storage.get('{{name}}') || null;
  }
{{/authMethods}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy