How do I reset google login configuration once I have set it for my meteor app?

后端 未结 5 1848
悲哀的现实
悲哀的现实 2021-02-01 23:58

I am learning meteor and have created a new app and installed accounts-core, accounts-google and accounts-ui. This worked as expected and prompted me to configure the google in

相关标签:
5条回答
  • 2021-02-02 00:02

    A meteor reset will bring everything back to 0, use it wisely.

    0 讨论(0)
  • 2021-02-02 00:09

    How about this.

    Clearing only account configuration.I have tried in my project.

    meteor mongo

    $ meteor mongo
    MongoDB shell version: 2.4.3
    connecting to: 127.0.0.1:3002/meteor
    > show collections
    meteor_accounts_loginServiceConfiguration
    posts
    system.indexes
    users
    > db.meteor_accounts_loginServiceConfiguration
    meteor.meteor_accounts_loginServiceConfiguration
    > db.meteor_accounts_loginServiceConfiguration.find()
    { "service" : "twitter", "consumerKey" : "MYconsumerKey", "secret" : "MYsecret", "_id" : "MYid" }
    >
    > db.meteor_accounts_loginServiceConfiguration.remove()
    

    Clearing all data in your project.

    $ meteor reset -h
    Usage: meteor reset
    
    Reset the current project to a fresh state. Removes all local
    data and kills any running meteor development servers.
    
    0 讨论(0)
  • 2021-02-02 00:14

    If you need to do this on your production server, where you don't have meteor but you can run mongo from the shell, then the process is pretty similar:

    $ mongo
    ...
    Welcome to the MongoDB shell.
    ...
    > show dbs
    foo           0.078GB
    bar           0.078GB
    my_meteor_db  0.078GB
    > use my_meteor_db
    switched to my_meteor_db
    > show collections
    ...
    > db.meteor_accounts_loginServiceConfiguration.find()
    ...
    > db.meteor_accounts_loginServiceConfiguration.remove({service:"google"})
    WriteResult({ "nRemoved" : 1 })
    > exit
    bye
    $
    
    0 讨论(0)
  • 2021-02-02 00:19

    First, add the service configuration package:

    meteor add service-configuration
    

    Then, in your app in the system folder (create it if you don't have one) add a file called service.js and in there add:

    // first, remove configuration entry in case service is already configured
    ServiceConfiguration.configurations.remove({
      service: "google"
    });
    ServiceConfiguration.configurations.insert({
      service: "google",
      clientId: "123456789",
      loginStyle: "popup",
      secret: "8j4ldfjSECRET-HEREalkjf8slk"
    });
    

    Further Reading:
    Meteor Docs - Login With External Service

    0 讨论(0)
  • 2021-02-02 00:19

    This is just a light revision in snize's answer, but this worked for me:

    $ meteor mongo
    MongoDB shell version: 2.4.3
    connecting to: 127.0.0.1:3002/meteor
    > db.meteor_accounts_loginServiceConfiguration.remove({"service":"google"})
    
    0 讨论(0)
提交回复
热议问题