-jraphical      = require 'jraphical'
+hat       = require 'hat'
+jraphical = require 'jraphical'
 
 module.exports = class JCredential extends jraphical.Module
 

  JGroup             = require '../group'
  JCredentialData    = require './credentialdata'
  { PROVIDERS }      = require './computeutils'

  KodingError        = require '../../error'


        callback new KodingError 'Provider is not supported'
        return

      CredentialStore.create client, { meta, originId }, (err, identifier) ->
        return  if failed err, callback

        _data = { provider, title, identifier, originId }

        if provider in ['custom', 'userInput']
          _data.fields   = (Object.keys meta) or []
